osx - How to unpack and pack pkg file? -
i have pkg file created install maker mac. want replace 1 file in pkg. must under linux system, because part of download process. when user starts download file server must replace 1 file in pkg. have solution how unpack pkg , replace file dont know how pack again pkg. http://emresaglam.com/blog/1035 http://ilostmynotes.blogspot.com/2012/06/mac-os-x-pkg-bom-files-package.html
packages .xar archives different extension , specified file hierarchy. unfortunately, part of file hierarchy cpio.gz archive of actual installables, , that's want edit. , there's bom file includes information on files inside cpio archive, , packageinfo file includes summary information.
if need edit 1 of info files, that's simple:
mkdir foo cd foo xar -xf ../foo.pkg # edit stuff xar -cf ../foo-new.pkg * but if need edit installable files:
mkdir foo cd foo xar -xf ../foo.pkg cd foo.pkg cat payload | gunzip -dc |cpio -i # edit foo.app/* rm payload find ./foo.app | cpio -o | gzip -c > payload mkbom foo.app bom # or edit bom # edit packageinfo rm -rf foo.app cd .. xar -cf ../foo-new.pkg i believe can mkbom (and lsbom) linux distros. (if can ditto, makes things easier, i'm not sure if that's ubiquitously available.)
Comments
Post a Comment