• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Query for package id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Query for package id


  • Subject: Re: Query for package id
  • From: Greg Neagle <email@hidden>
  • Date: Wed, 15 Jul 2009 15:37:58 -0700

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
  • Follow-Ups:
    • Re: Query for package id
      • From: "Charles E. Heizer" <email@hidden>
References: 
 >Query for package id (From: "Charles E. Heizer" <email@hidden>)

  • Prev by Date: Query for package id
  • Next by Date: Re: Query for package id
  • Previous by thread: Query for package id
  • Next by thread: Re: Query for package id
  • Index(es):
    • Date
    • Thread