diff options
author | Just van Rossum <just@letterror.com> | 2003-06-20 21:43:36 (GMT) |
---|---|---|
committer | Just van Rossum <just@letterror.com> | 2003-06-20 21:43:36 (GMT) |
commit | dc31dc02f77a2c0e3c32593a0d32c5d9547bed13 (patch) | |
tree | b155d6e83bddda4bab4769ad177a0773aeb1bcdf /Lib/plat-mac/bundlebuilder.py | |
parent | b6b988bceb9ea2bc40ebfa4c0b73debaa3e75659 (diff) | |
download | cpython-dc31dc02f77a2c0e3c32593a0d32c5d9547bed13.zip cpython-dc31dc02f77a2c0e3c32593a0d32c5d9547bed13.tar.gz cpython-dc31dc02f77a2c0e3c32593a0d32c5d9547bed13.tar.bz2 |
- do the right thing with symlinks inside directories we're copying
- move the normpath stuff around a bit
- added dubious special case to addPythonFramework()
Diffstat (limited to 'Lib/plat-mac/bundlebuilder.py')
-rwxr-xr-x | Lib/plat-mac/bundlebuilder.py | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py index eb3a4a8..a88edc9 100755 --- a/Lib/plat-mac/bundlebuilder.py +++ b/Lib/plat-mac/bundlebuilder.py @@ -171,10 +171,10 @@ class BundleBuilder(Defaults): files = self.files[:] for path in self.resources: files.append((path, pathjoin("Contents", "Resources", - os.path.basename(os.path.normpath(path))))) + os.path.basename(path)))) for path in self.libs: files.append((path, pathjoin("Contents", "Frameworks", - os.path.basename(os.path.normpath(path))))) + os.path.basename(path)))) if self.symlink: self.message("Making symbolic links", 1) msg = "Making symlink from" @@ -488,9 +488,16 @@ class AppBuilder(BundleBuilder): def addPythonFramework(self): # If we're building a standalone app with Python.framework, - # include a minimal subset of Python.framework + # include a minimal subset of Python.framework, *unless* + # Python.framework was specified manually in self.libs. + for lib in self.libs: + if os.path.basename(lib) == "Python.framework": + # a Python.framework was specified as a library + return + frameworkpath = sys.exec_prefix[:sys.exec_prefix.find( "Python.framework") + len("Python.framework")] + version = sys.version[:3] frameworkpath = pathjoin(frameworkpath, "Versions", version) destbase = pathjoin("Contents", "Frameworks", "Python.framework", @@ -693,7 +700,7 @@ def copy(src, dst, mkdirs=0): if mkdirs: makedirs(os.path.dirname(dst)) if os.path.isdir(src): - shutil.copytree(src, dst) + shutil.copytree(src, dst, symlinks=1) else: shutil.copy2(src, dst) @@ -794,7 +801,7 @@ def main(builder=None): elif opt in ('-n', '--name'): builder.name = arg elif opt in ('-r', '--resource'): - builder.resources.append(arg) + builder.resources.append(os.path.normpath(arg)) elif opt in ('-f', '--file'): srcdst = arg.split(':') if len(srcdst) != 2: @@ -812,7 +819,7 @@ def main(builder=None): elif opt == '--iconfile': builder.iconfile = arg elif opt == "--lib": - builder.libs.append(arg) + builder.libs.append(os.path.normpath(arg)) elif opt == "--nib": builder.nibname = arg elif opt in ('-p', '--plist'): |