Results 1 to 2 of 2
  1. #1

    jnojr's Avatar
    Member Since
    Aug 11, 2012
    Location
    San Diego, CA
    Posts
    85
    Question How to create package from command line?
    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.

  2. #2

    jnojr's Avatar
    Member Since
    Aug 11, 2012
    Location
    San Diego, CA
    Posts
    85
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Create app from command line tool
    By wvtrammell in forum OS X - Development and Darwin
    Replies: 6
    Last Post: 01-09-2014, 08:46 PM
  2. Compare OS X command line to Linux command line?
    By V6Pony in forum OS X - Development and Darwin
    Replies: 5
    Last Post: 09-26-2013, 01:32 PM
  3. Replies: 1
    Last Post: 09-13-2012, 01:59 AM
  4. Replies: 0
    Last Post: 09-12-2012, 01:32 AM
  5. How do I create a package
    By aecaudel in forum OS X - Operating System
    Replies: 5
    Last Post: 06-13-2011, 08:29 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •