From b50fbe8263ab56212f50759cce84cb8b0f7f0e9a Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 6 Aug 2015 15:49:26 +0200 Subject: [PATCH] Restore old packp3d behavior: main file should be considered relative to -d directory --- direct/src/p3d/packp3d.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/direct/src/p3d/packp3d.py b/direct/src/p3d/packp3d.py index 7dbe3a30b9..3544022fd6 100755 --- a/direct/src/p3d/packp3d.py +++ b/direct/src/p3d/packp3d.py @@ -170,19 +170,20 @@ def makePackedApp(args): appDir = Filename('.') appBase = appFilename.getBasenameWoExtension() - if not main: + if main: + main = Filename.fromOsSpecific(main) + main.makeAbsolute(root) + else: main = Filename(root, 'main.py') - if main.exists(): - main = 'main.py' - else: + if not main.exists(): main = glob.glob(os.path.join(root.toOsSpecific(), '*.py')) if len(main) == 0: raise ArgumentError, 'No Python files in root directory.' elif len(main) > 1: raise ArgumentError, 'Multiple Python files in root directory; specify the main application with -m "main".' - main = os.path.split(main[0])[1] - main = Filename.fromOsSpecific(main) + main = Filename.fromOsSpecific(os.path.split(main[0])[1]) + main.makeAbsolute(root) packager.installDir = appDir packager.allowPythonDev = allowPythonDev