- I only care about my home directory. When the system's hard disk shits the bed, I buy a new one and then do a reinstall from scratch. I restore my home directory and then install the software packages I have in my home directory. I find this to be easier than backing up the entire system.
- I don't want to wait to backup the entire system, which is currently 138GB and like a kid on Flintstone vitamins...growing.
- The --root option to packagemaker is a bit picky. You have a add a trailing slash on the path you specify, otherwise your staging root directory will end up on the target system. For example:
The resulting package will install /pkg-root to your system (dumb!). You have to run it this way:
# put stuff in ./pkg-root for the package
packagemaker --root ./pkg-root [options]
And then pkg-root is treated like a staging root.
packagemaker --root ./pkg-root/
- To show all installed packages on the system:
However, this only shows packages that pkgutil can see. It won't show you any installed packages recorded in /Library/Receipts. It only shows packages with an entry in /Library/Receipts/boms. The locations appear to be mutually exclusive. Why?
It is possible to remove an entry from the installed packages database. All you have to do is:
pkgutil --forget PACKAGE
This removes the entry from the database, but not what is actually on the system. Why is this even possible? Also note that this will again only work for what packages pkgutil can see. If you want to forget something in /Library/Receipts, just
rm -rfthe directory.
Want to completely hork your system? pkgutil does offer a way to forget a package and remove the files it owns. You can do this:
pkgutil --unlink PACKAGE
pkgutil --forget PACKAGE
No dependency checking is done, pkgutil just deletes whatever is owned by that package. You do this on the BSD package, for instance, and totally hose the system. Great work, Apple.
If you pass the --target option to packagemaker, the resulting flat package it generates won't contain anything from --resources. It just ignores Resources. Great!
The different package formats created by packagemaker appear to be recorded differently in /Library/Receipts. A flat package gets a bom file in the /Library/Receipts/boms subdirectory. A package bundle with metadata gets a receipt bundle as /Library/Receipts/NAME.pkg with the bom file in the bundle as Archive.bom.
So that's what I've discovered trying to package software on MacOS X. It's frustrating and annoying. Packaging is a solved problem. And uninteresting. Why can't OS X just use any of the dozens of packaging systems out there that are open source?