Re: Command in Macintosh for mapping package name and package id
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