Command Line Tool. Integrating Packages into an automated production workflow is easy with the packagesbuild command line tool. Once you have created your Packages project, the packagesbuild tool will let you build it from the Terminal, a shell script or an Xcode Run Script Build phase. I sometimes need to install updates remotely on a server I maintain. I already knew about the command line version of softwareupdate, but I was looking for a way to install packages (.pkg) that were already located on the remote box. I finally found the installer command. To install a package, type: sudo installer -pkg Desktop/Java1.4.1.pkg.
Create an OS X package from the command line | 8 comments | Create New Account
Click here to return to the 'Create an OS X package from the command line' hint |
Line Mac App
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Mac Command Line
Will this break resource forks? I often use hfstar but can't rely on users to have it.
WOW!!! I am all for CLI stuff and am trying to do everything I can using CLI - but thats incredibly difficult compared to using the PackageMaker that comes with Developer Tools. For info on using PackageMaker
http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/InstallIntegrate/chapter_13_section_18.html
http://developer.apple.com/techpubs/macosx/Essentials/SystemOverview/InstallIntegrate/chapter_13_section_18.html
You probably have to have Dev registration but its free. If you have downloaded Developer Tools, you are already registered to do that.
I was just learning how to create packages this weekend, and I was surprised how easy it actually is.
The GUI is great for a one off. But for anything that requires consistency, anything that you do again and again, the CLI is great because it's scriptable. Script it and forget it.
That's right!
Short answer: Unfortunately, probably not.
Longer answer:
Within an Apple installer pkg, the files to be installed are all stored in the Archive.pax.gz file. So while the pkg itself and its contents are safe to tar up, the pax utility does not support resource forks AFAIK.
Within an Apple installer pkg, the files to be installed are all stored in the Archive.pax.gz file. So while the pkg itself and its contents are safe to tar up, the pax utility does not support resource forks AFAIK.
Package Mac Command Line As Appointment
Also, I don't know whether the package command-line utility calls pax to do its work or whether the necessary functions are built-in to package along with some kind of added resourcefork support.
There may be a way to hack the pkg after it's been built with package, by manually using the hfspax utility to build a replacement Archive.pax.gz, but would the Installer app honour the resource forks when it's time to install? (hfspax is available in Fink).
If anyone has time to experiment with this, please post your results here.
/usr/bin/package is a csh script (yuk!); view it and you'll see it uses pax.
AFAIK, hfstar (and hfspax?) make archives with the resource forks stored in them as somdir/somefile/..namedFork/rsrc so when they come out i *think* that standard tar or pax will un-archive them properly. anyone out there know for sure?
---
Pell
Awesome! I've been waiting for this kind of information for a while. And yes, PackageMaker is there but this is exactly the kind of stuff you want to automate and forget. ---
Pell
Mac Command Line Tools
Thank you! You just made my projects much easier.