Removing pkg receipts in 10.6
I have a few payload free packages that are used simply to run a post-flight script.
For example, joining a Mac to Active Directory with the "dsconfigad" command, or simply uninstalling software with the "rm" command.
In cases like this I usually also delete the pkg receipt.
For 10.4 and 10.5 it was simple.
I setup this variable
PackageName=$( /usr/bin/basename "$PackagePath" )
Then I run this to remove the receipt.
##########
RemovePackageReceipt () {
rm -rv "${TargetVolume}/Library/Receipts/${PackageName}"
}
RemovePackageReceipt
##########
The thing I run into with 10.6 is a kind of chicken and the egg problem. The receipts do not show up in /private/var/db/receipts until the installer is finished.
So the rm command in the post-flight script has nothing to delete.
I have some ideas for using the pkgutil command, but it too has nothing to delete.
So I end up with two questions.
Does anyone have any suggestions for removing the receipt for 10.6?
What is everyone's general philosophy about removing a package receipt?