Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Query for package id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query for package id



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 (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Query for package id (From: "Charles E. Heizer" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.