From b469a507a1a57d20b7c119b0cbb7bb33b64f002a Mon Sep 17 00:00:00 2001 From: David Rose Date: Mon, 19 Oct 2009 13:45:51 +0000 Subject: [PATCH] minor fixes --- direct/src/p3d/PackageInfo.py | 6 ++++-- direct/src/p3d/Packager.py | 3 ++- direct/src/p3d/packp3d.py | 14 +++++++------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/direct/src/p3d/PackageInfo.py b/direct/src/p3d/PackageInfo.py index 18f25bc12b..b1396862cf 100644 --- a/direct/src/p3d/PackageInfo.py +++ b/direct/src/p3d/PackageInfo.py @@ -820,8 +820,6 @@ class PackageInfo: vfs = VirtualFileSystem.getGlobalPtr() vfs.mount(mf, root, vfs.MFReadOnly) - appRunner.loadMultifilePrcFiles(mf, root) - # Add this to the Python search path, if it's not already # there. We have to take a bit of care to check if it's # already there, since there can be some ambiguity in @@ -851,6 +849,10 @@ class PackageInfo: envvar = '%s_ROOT' % (self.packageName.upper()) ExecutionEnvironment.setEnvironmentVariable(envvar, self.packageDir.toOsSpecific()) + # Now that the environment variable is set, read all of the + # prc files in the package. + appRunner.loadMultifilePrcFiles(mf, root) + # Also, find any toplevel Python packages, and add these as # shared packages. This will allow different packages # installed in different directories to share Python files as diff --git a/direct/src/p3d/Packager.py b/direct/src/p3d/Packager.py index ca628743d6..bf3e0dbae7 100644 --- a/direct/src/p3d/Packager.py +++ b/direct/src/p3d/Packager.py @@ -352,7 +352,8 @@ class Packager: self.compressionLevel = 6 # Every p3dapp requires panda3d. - self.packager.do_require('panda3d') + if 'panda3d' not in map(lambda p: p.packageName, self.requires): + self.packager.do_require('panda3d') # If this flag is set, enable allow_python_dev. if self.packager.allowPythonDev: diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index eb3b92f55c..adaab86909 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -44,7 +44,7 @@ Options: Sets the indicated config flag in the application. This option may be repeated as necessary. - -r package + -r package[,version[,hostURL]] Names an additional package that this application requires at startup time. The default package is 'panda3d'; you may repeat this option to indicate dependencies on additional packages. @@ -106,7 +106,11 @@ def makePackedApp(args): elif option == '-c': configFlags.append(value.split('=', 1)) elif option == '-r': - requires.append(value) + tokens = value.split(',') + while len(tokens) < 3: + tokens.append('') + name, version, host = tokens[:3] + requires.append((name, version, host)) elif option == '-s': packager.installSearch.appendDirectory(Filename.fromOsSpecific(value)) elif option == '-D': @@ -159,11 +163,7 @@ def makePackedApp(args): try: packager.setup() packager.beginPackage(appBase, p3dApplication = True) - for requireName in requires: - tokens = requireName.split(',') - while len(tokens) < 3: - tokens.append(None) - name, version, host = tokens + for name, version, host in requires: packager.do_require(name, version = version, host = host) if configFlags: