From 06f05d2ecc7d0f7e778ea2e2f13b70c873592768 Mon Sep 17 00:00:00 2001 From: David Rose Date: Tue, 27 Oct 2009 00:41:03 +0000 Subject: [PATCH] failed attempt to run on osx 10.4 --- direct/src/plugin_installer/make_installer.py | 42 ++++++++++++++----- 1 file changed, 31 insertions(+), 11 deletions(-) diff --git a/direct/src/plugin_installer/make_installer.py b/direct/src/plugin_installer/make_installer.py index 02ed3b9d5e..84a44a6ef2 100755 --- a/direct/src/plugin_installer/make_installer.py +++ b/direct/src/plugin_installer/make_installer.py @@ -374,18 +374,34 @@ def makeInstaller(): shutil.copytree(pluginFiles[npapi], dst_npapi) shutil.copyfile(pluginFiles[panda3d], dst_panda3d) shutil.copytree(pluginFiles[panda3dapp], dst_panda3dapp) - CMD = "/Developer/usr/bin/packagemaker" - CMD += ' --id org.panda3d.pkg.runtime' #TODO: maybe more customizable? - CMD += ' --version "%s"' % options.version - CMD += ' --title "%s"' % options.long_name - CMD += ' --out p3d-setup.pkg' - CMD += ' --target %s' % platform.mac_ver()[0][:4] - CMD += ' --domain system' - CMD += ' --root "%s"' % tmproot + + packagemaker = "/Developer/usr/bin/packagemaker" + if os.path.exists(packagemaker): + # PackageMaker 3.0 or better, e.g. OSX 10.5. + CMD = packagemaker + CMD += ' --id org.panda3d.pkg.runtime' #TODO: maybe more customizable? + CMD += ' --version "%s"' % options.version + CMD += ' --title "%s"' % options.long_name + CMD += ' --out p3d-setup.pkg' + CMD += ' --target %s' % platform.mac_ver()[0][:4] + CMD += ' --domain system' + CMD += ' --root "%s"' % tmproot + else: + # PackageMaker 2.0, e.g. OSX 10.4. + packagemaker = "/Developer/Tools/packagemaker" + CMD = packagemaker + CMD += ' -build' + CMD += ' -f "%s"' % tmproot + CMD += ' -p p3d-setup.pkg' + # Hmm, this isn't enough. I guess we have to build up an + # Info.plist file in this case? It's not clear what the + # contents of this file should look like. print "" print CMD - subprocess.call(CMD, shell = True) + result = subprocess.call(CMD, shell = True) + if result: + sys.exit(result) shutil.rmtree(tmproot) # Pack the .pkg into a .dmg @@ -395,7 +411,9 @@ def makeInstaller(): CMD = 'hdiutil create "%s" -srcfolder "%s"' % (tmpdmg, tmproot) print "" print CMD - subprocess.call(CMD, shell = True) + result = subprocess.call(CMD, shell = True) + if result: + sys.exit(result) shutil.rmtree(tmproot) # Compress the .dmg (and make it read-only) @@ -404,7 +422,9 @@ def makeInstaller(): CMD = 'hdiutil convert "%s" -format UDBZ -o "p3d-setup.dmg"' % tmpdmg print "" print CMD - subprocess.call(CMD, shell = True) + result = subprocess.call(CMD, shell = True) + if result: + sys.exit(result) else: # Now build the NSIS command.