Methods

PKGUtil

/usr/sbin/pkgutil

developer.apple.com/library/mac/documentation/Darwin/Reference/Manpages/man1/pkgutil.1.html

Public Class Methods

read(input) click to toggle source

Perform read-only actions on the input package.

If a block is given the block will be yielded with the path of the package expanded directory, otherwise a shell will be open.

input - The String path to the input package.

# File lib/iesd/utility/pkgutil.rb, line 14
def self.read input
  Dir.mktmpdir { |tmp|
    tmp = File.join tmp, File.basename(input)
    expand input, tmp
    if block_given?
      yield tmp
    else
      shell tmp
    end
  }
end
write(input, output = input) click to toggle source

Perform read-write actions on the input package and export as the output package.

If a block is given the block will be yielded with the path of the package expanded directory, otherwise a shell will be open.

input - The String path to the input package. output - The String path to the output package.

# File lib/iesd/utility/pkgutil.rb, line 32
def self.write input, output = input
  Dir.mktmpdir { |tmp|
    tmp = File.join tmp, File.basename(input)
    expand input, tmp
    if block_given?
      yield tmp
    else
      shell tmp
    end
    flatten tmp, output
  }
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.