Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
Apple Computing Products:
macOS - Operating System
How to create package from command line?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="jnojr" data-source="post: 1495162" data-attributes="member: 267096"><p>The only relevant post I can find is <a href="http://hints.macworld.com/article.php?story=20030619213002144" target="_blank">Create an OS X package from the command line - Mac OS X Hints</a> but it isn't very helpful... man package says there is no such option as "dstroot", and also gives no examples of how to create. That post also refers to somehow coming up with an info file but gives a bad link.</p><p></p><p>Here's the scoop... I have a package that I modified. It's a XAR archive, so I broke it open, opened up the payload (which was a gripped cpio archive), modified one line in one file, and reversed my steps. But when I run my resulting package, I get:</p><p></p><p>[CODE]</p><p>Feb 11 14:46:53 flamingo installd[95098]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=110 "An error occurred while extracting files from the package “cma.pkg”." UserInfo=0x103ba63f0 {NSLocalizedDescription=An error occurred while extracting files from the package “cma.pkg”., NSURL=file://localhost/Users/jnojr/tmp2/assets/cma.pkg#cma.pkg, PKInstallPackageIdentifier=comp.nai.cmamac, NSUnderlyingError=0x103b9d810 "The operation couldn’t be completed. cpio read error: bad file format"} {</p><p> NSLocalizedDescription = "An error occurred while extracting files from the package \U201ccma.pkg\U201d.";</p><p> NSURL = "file://localhost/Users/jnojr/tmp2/assets/cma.pkg#cma.pkg";</p><p> NSUnderlyingError = "Error Domain=BOMCopierFatalError Code=1 \"The operation couldn\U2019t be completed. cpio read error: bad file format\" UserInfo=0x103ba73b0 {NSLocalizedFailureReason=cpio read error: bad file format, offset=16222840, type=BOMCopierFatalError, sourcePath=/Users/jnojr/tmp2/assets/cma.pkg, destinationPath=/tmp/PKInstallSandbox.TAKSaX/Scripts/comp.nai.cmamac.Ci5OOT}";</p><p> PKInstallPackageIdentifier = "comp.nai.cmamac";</p><p> }</p><p>Feb 11 14:46:53 flamingo installer[95094]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=110 "An error occurred while extracting files from the package “cma.pkg”." UserInfo=0x7fe88946daa0 {NSUnderlyingError=0x7fe88946c050 "The operation couldn’t be completed. cpio read error: bad file format", NSURL=file://localhost/Users/jnojr/tmp2/assets/cma.pkg#cma.pkg, PKInstallPackageIdentifier=comp.nai.cmamac, NSLocalizedDescription=An error occurred while extracting files from the package “cma.pkg”.}</p><p>Feb 11 14:46:54 flamingo installer[95094]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.</p><p>[/CODE]</p><p></p><p>The steps I took to create my package:</p><p></p><p>cd tmp2; xar -xf /Volumes/MFECMA/cma.pkg</p><p>cd cma.pkg</p><p>mkdir tmp; cd tmp</p><p>cat ../Payload | gunzip -dc | cpio -i</p><p>EDIT FILE</p><p>rm -f ../Payload</p><p>find . | cpio -o | gzip -c > ../Payload</p><p>cd ..</p><p>rm -fr tmp</p><p>cd ..</p><p>xar -cf ../cma.pkg .</p><p></p><p>I'm not sure if I screwed up, did a typo, or what. Or if there's another process that I need to follow.</p></blockquote><p></p>
[QUOTE="jnojr, post: 1495162, member: 267096"] The only relevant post I can find is [url=http://hints.macworld.com/article.php?story=20030619213002144]Create an OS X package from the command line - Mac OS X Hints[/url] but it isn't very helpful... man package says there is no such option as "dstroot", and also gives no examples of how to create. That post also refers to somehow coming up with an info file but gives a bad link. Here's the scoop... I have a package that I modified. It's a XAR archive, so I broke it open, opened up the payload (which was a gripped cpio archive), modified one line in one file, and reversed my steps. But when I run my resulting package, I get: [CODE] Feb 11 14:46:53 flamingo installd[95098]: PackageKit: Install Failed: Error Domain=PKInstallErrorDomain Code=110 "An error occurred while extracting files from the package “cma.pkg”." UserInfo=0x103ba63f0 {NSLocalizedDescription=An error occurred while extracting files from the package “cma.pkg”., NSURL=file://localhost/Users/jnojr/tmp2/assets/cma.pkg#cma.pkg, PKInstallPackageIdentifier=comp.nai.cmamac, NSUnderlyingError=0x103b9d810 "The operation couldn’t be completed. cpio read error: bad file format"} { NSLocalizedDescription = "An error occurred while extracting files from the package \U201ccma.pkg\U201d."; NSURL = "file://localhost/Users/jnojr/tmp2/assets/cma.pkg#cma.pkg"; NSUnderlyingError = "Error Domain=BOMCopierFatalError Code=1 \"The operation couldn\U2019t be completed. cpio read error: bad file format\" UserInfo=0x103ba73b0 {NSLocalizedFailureReason=cpio read error: bad file format, offset=16222840, type=BOMCopierFatalError, sourcePath=/Users/jnojr/tmp2/assets/cma.pkg, destinationPath=/tmp/PKInstallSandbox.TAKSaX/Scripts/comp.nai.cmamac.Ci5OOT}"; PKInstallPackageIdentifier = "comp.nai.cmamac"; } Feb 11 14:46:53 flamingo installer[95094]: install:didFailWithError:Error Domain=PKInstallErrorDomain Code=110 "An error occurred while extracting files from the package “cma.pkg”." UserInfo=0x7fe88946daa0 {NSUnderlyingError=0x7fe88946c050 "The operation couldn’t be completed. cpio read error: bad file format", NSURL=file://localhost/Users/jnojr/tmp2/assets/cma.pkg#cma.pkg, PKInstallPackageIdentifier=comp.nai.cmamac, NSLocalizedDescription=An error occurred while extracting files from the package “cma.pkg”.} Feb 11 14:46:54 flamingo installer[95094]: Install failed: The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance. [/CODE] The steps I took to create my package: cd tmp2; xar -xf /Volumes/MFECMA/cma.pkg cd cma.pkg mkdir tmp; cd tmp cat ../Payload | gunzip -dc | cpio -i EDIT FILE rm -f ../Payload find . | cpio -o | gzip -c > ../Payload cd .. rm -fr tmp cd .. xar -cf ../cma.pkg . I'm not sure if I screwed up, did a typo, or what. Or if there's another process that I need to follow. [/QUOTE]
Verification
Name this item. 🍎
Post reply
Forums
Apple Computing Products:
macOS - Operating System
How to create package from command line?
Top