@@ -157,7 +157,7 @@ def writePlistToString(plistObject):
157157
158158
159159quickpkg_version = '0.7'
160- supported_extensions = ['dmg' , 'app' , 'zip' ]
160+ supported_extensions = ['dmg' , 'app' , 'zip' , 'xip' ]
161161
162162
163163# modeled after munkiimport but to build a pkg
@@ -441,6 +441,28 @@ if __name__ == "__main__":
441441 print foundapps
442442 cleanup_and_exit (1 )
443443
444+ # if item is xip, extract to tmp location and find useful contents
445+ if item_extension == 'xip' :
446+ cwd = os .getcwd ()
447+ unarchive_path = os .path .join (tmp_path , "unarchive" )
448+ os .makedirs (unarchive_path )
449+ os .chdir (unarchive_path )
450+ xip_cmd = ["/usr/bin/xip" , "--expand" , item_path ]
451+ result = cmdexec (xip_cmd )
452+ os .chdir (cwd )
453+ if result ["return_code" ] != 0 :
454+ print "An error occured while expanding xip archive:"
455+ print "%d, %s" % (result ["return_code" ], result ["stderr" ])
456+ cleanup_and_exit (1 )
457+ foundapps = finditemswithextension (unarchive_path , 'app' )
458+ if len (foundapps ) == 0 :
459+ print "Could not find an application!"
460+ cleanup_and_exit (1 )
461+ elif len (foundapps ) > 1 :
462+ print "Found too many Applications! Can't decide!"
463+ print foundapps
464+ cleanup_and_exit (1 )
465+
444466 logger ("Found application: %s" % foundapps [0 ], 1 )
445467
446468 # copy found app to payload folder
0 commit comments