Creating Snapshot Packages
A snapshot package is a two-step process allowing you to easily make a package containing all files added to a directory after a certain point in time. In the first step, a snapshot of the directory is taken, and stored into a .snapshot bundle. In the second step, this snapshot is compared against the current state of the directory and a package is created containing the files added since the snapshot. Both steps are currently done using the PackageMaker CLI.
Creating the Snapshot
To create a snapshot package, you must first create the snapshot which will later be compared against the directory. To create a snapshot, use the following command:
/Developer/Tools/packagemaker --snapshot root-path destination-path
For example, to snapshot ~/Documents/MyGreatApp
, you might use:
/Developer/Tools/packagemaker --snapshot ~/Documents/MyGreatApp ~/Docments/MyGreatApp.snapshot
typed on one line. This would create the snapshot directory ~/Documents/MyGreatApp.snapshot
. The structure of this directory would be as follows:
- MyGreatApp.snapshot - Contents Info.plist snapshot.bom
The Info.plist contains the path to the original directory. The snapshot.bom file is a bill-of-materials file specifying the contents of the directory when the snapshot was taken.
Creating the Snapshot Package
After creating the snapshot and adding whatever files you like to the directory, you can create a snapshot package containing only the added files. This is done much like creating a normal package with the CLI:
/Developer/Tools/packagemaker -build -snapshot snapshot-path [other options]
Essentially, in addition to all the normal CLI options, you specify the path to the snapshot directory. Note however that you do not need to specify a root directory - PackageMaker will use the directory specified in the Info.plist of the snapshot directory. For a full description of the other available options, see the packagemaker
man page.