• 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: Command in Macintosh for mapping package name and package id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Command in Macintosh for mapping package name and package id


  • Subject: Re: Command in Macintosh for mapping package name and package id
  • From: Per Olofsson <email@hidden>
  • Date: Fri, 03 Feb 2012 10:24:33 +0000
  • Thread-topic: Command in Macintosh for mapping package name and package id

3 feb 2012 kl. 10:00 skrev Andreas Xenos:

> a=`pkgutil --files pkgID`
> results=(`awk -F'\n' '$1=$1' <<<'$a'`)
> echo ${results[0]}

Cool, this kinda works if you change it to double quotes around $a:

>> #!/bin/bash
>>
>> a=`pkgutil --files "$1"`
>> results=(`awk -F'\n' '$1=$1' <<<"$a"`)
>> echo ${results[0]}

Results vary though, and more often than not doesn't give you anything useful:

MBPro15:prog pelle$ for pkgid in `pkgutil --pkgs`; do echo -n "$pkgid: "; ./pkgid.sh $pkgid; done
[…]
com.apple.pkg.X11User: Applications
com.apple.pkg.XcodeEssentialsSystemSupportLeo: System
com.apple.pkg.XcodeUserSystemSupportLeo: System
com.apple.pkg.xcrunLeo: usr
com.att.graphviz.cli.pkg: bin
com.att.graphviz.gui.pkg: Graphviz.app
com.crashplan.app.pkg: CrashPlan.app
com.deploystudio.admin.pkg: DeployStudio
com.google.pkg.GoogleVoiceAndVideo: Library
com.google.pkg.Keystone:
com.googlecode.munki.admin: private
com.microsoft.lync.all.lync.pkg.14.0.0: Applications
com.microsoft.lync.all.lync.pkg.14.0.1.update: Applications
com.microsoft.lync.all.meetingjoinplugin.pkg.14.0.0: Library
com.microsoft.lync.all.meetingjoinplugin.pkg.14.0.1.update: Library
[…]

> Applescript can be used to retrieve the name of an application using its id:
>
> get name of application id "pkgID"

Interesting, but I'm not having much luck:

MBPro15:Sharepoint pelle$ osascript -e 'get name of application id "com.crashplan.app.pkg"'
4:50: syntax error: Can’t get application id "com.crashplan.app.pkg". (-1728)
MBPro15:Sharepoint pelle$ osascript -e 'get name of application id "org.macports.MacPorts"'
4:50: syntax error: Can’t get application id "org.macports.MacPorts". (-1728)
MBPro15:Sharepoint pelle$ osascript -e 'get name of application id "com.parallels.pkg.virtualization"'
4:61: syntax error: Can’t get application id "com.parallels.pkg.virtualization". (-1728)

--
Per Olofsson
System Administrator, IT-services, University of Gothenburg


 _______________________________________________
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: Command in Macintosh for mapping package name and package id
      • From: Ben Gollmer <email@hidden>
References: 
 >Command in Macintosh for mapping package name and package id (From: Nandini Vijayashankar <email@hidden>)
 >Re: Command in Macintosh for mapping package name and package id (From: Stephane Sudre <email@hidden>)
 >Re: Command in Macintosh for mapping package name and package id (From: Greg Neagle <email@hidden>)

  • Prev by Date: Re: Command in Macintosh for mapping package name and package id
  • Next by Date: Re: Command in Macintosh for mapping package name and package id
  • Previous by thread: Re: Command in Macintosh for mapping package name and package id
  • Next by thread: Re: Command in Macintosh for mapping package name and package id
  • Index(es):
    • Date
    • Thread