New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Operating System General OS operation information and support

How to create package from command line?


Post Reply New Thread Subscribe

 
Thread Tools
jnojr

 
jnojr's Avatar
 
Member Since: Aug 11, 2012
Location: San Diego, CA
Posts: 85
jnojr will become famous soon enough

jnojr is offline
The only relevant post I can find is Create an OS X package from the command line - Mac OS X Hints 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.
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 Thanks
jnojr

 
jnojr's Avatar
 
Member Since: Aug 11, 2012
Location: San Diego, CA
Posts: 85
jnojr will become famous soon enough

jnojr is offline
I found pkgbuild, and tried:

pkgbuild --analyze --root /tmp/Sample.dst components.plist
pkgbuild --identifier com.sample.pkg.app --root /tmp/Sample.dst --component-plist components-edited.plist Sample.pkg

That didn't work either... it created a package that seemed to run successfully, but didn't actually do anything.
QUOTE Thanks

Post Reply New Thread Subscribe


« Deleting files permanently | JAVA crash »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
How do I create a package aecaudel OS X - Operating System 5 06-13-2011 07:29 AM
Software to create a bootable disk image nigelivy OS X - Apps and Games 1 04-24-2009 06:48 AM
How to create Playlist Folders in iTunes jbhai OS X - Apps and Games 1 02-14-2009 08:32 AM

All times are GMT -4. The time now is 01:40 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?