site_archiver@lists.apple.com Delivered-To: installer-dev@lists.apple.com Thread-index: AcoFnqx+MD9ZA7woShqsXHz/gXF8Lg== Thread-topic: Query for package id Hi Greg, Thanks, I had a feeling that was the answer :-( Charles On Jul 15, 2009, at 3:37 PM, Greg Neagle wrote:
In Leopard, pkgutil doesn't have info on all installed packages; it tracks only the new Leopard flat packages. What you have to do is first check pkgutil:
pkgutil --pkg-info <pkgid>
If that turns up nothing, you'll need to loop through all the receipts in /Library/Receipts and examine the Info.plist files:
/Library/Receipts/PackageName.pkg/Contents/Info.plist
From the Info.plist, you'll need to look at CFBundleIdentifier and CFBundleShortVersionString. Some packages also have a version.plist at /Library/Receipts/ PackageName.pkg/Contents/version.plist, which has additional version info.
There's some Python code to do all of this in munki -- http://*code.google.com/p/munki
-Greg
On Jul 15, 2009, at 2:30 PM, Charles E. Heizer wrote:
Hello, I'm looking at creating a script to see if a package has been installed. So I have been looking through the man pages on pkgutil and installer and I dont see a logical way to join the two.
If I run "installer -pkginfo -verbose" on a pkg I get some useful information but no package identifiers or package identifier version. So what is the best approach to query pkgutil for a package if you dont have a package identifier?
thanks, Charles
_______________________________________________ Do not post admin requests to the list. They will be ignored. Installer-dev mailing list (Installer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/installer-dev/site_archiver%40lists.a... This email sent to site_archiver@lists.apple.com
participants (1)
-
Charles E. Heizer