Commit b08d147f authored by Just van Rossum's avatar Just van Rossum

- do the right thing with symlinks inside directories we're copying

- move the normpath stuff around a bit
- added dubious special case to addPythonFramework()
parent 2d8654d6
...@@ -171,10 +171,10 @@ class BundleBuilder(Defaults): ...@@ -171,10 +171,10 @@ class BundleBuilder(Defaults):
files = self.files[:] files = self.files[:]
for path in self.resources: for path in self.resources:
files.append((path, pathjoin("Contents", "Resources", files.append((path, pathjoin("Contents", "Resources",
os.path.basename(os.path.normpath(path))))) os.path.basename(path))))
for path in self.libs: for path in self.libs:
files.append((path, pathjoin("Contents", "Frameworks", files.append((path, pathjoin("Contents", "Frameworks",
os.path.basename(os.path.normpath(path))))) os.path.basename(path))))
if self.symlink: if self.symlink:
self.message("Making symbolic links", 1) self.message("Making symbolic links", 1)
msg = "Making symlink from" msg = "Making symlink from"
...@@ -488,9 +488,16 @@ class AppBuilder(BundleBuilder): ...@@ -488,9 +488,16 @@ class AppBuilder(BundleBuilder):
def addPythonFramework(self): def addPythonFramework(self):
# If we're building a standalone app with Python.framework, # 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( frameworkpath = sys.exec_prefix[:sys.exec_prefix.find(
"Python.framework") + len("Python.framework")] "Python.framework") + len("Python.framework")]
version = sys.version[:3] version = sys.version[:3]
frameworkpath = pathjoin(frameworkpath, "Versions", version) frameworkpath = pathjoin(frameworkpath, "Versions", version)
destbase = pathjoin("Contents", "Frameworks", "Python.framework", destbase = pathjoin("Contents", "Frameworks", "Python.framework",
...@@ -693,7 +700,7 @@ def copy(src, dst, mkdirs=0): ...@@ -693,7 +700,7 @@ def copy(src, dst, mkdirs=0):
if mkdirs: if mkdirs:
makedirs(os.path.dirname(dst)) makedirs(os.path.dirname(dst))
if os.path.isdir(src): if os.path.isdir(src):
shutil.copytree(src, dst) shutil.copytree(src, dst, symlinks=1)
else: else:
shutil.copy2(src, dst) shutil.copy2(src, dst)
...@@ -794,7 +801,7 @@ def main(builder=None): ...@@ -794,7 +801,7 @@ def main(builder=None):
elif opt in ('-n', '--name'): elif opt in ('-n', '--name'):
builder.name = arg builder.name = arg
elif opt in ('-r', '--resource'): elif opt in ('-r', '--resource'):
builder.resources.append(arg) builder.resources.append(os.path.normpath(arg))
elif opt in ('-f', '--file'): elif opt in ('-f', '--file'):
srcdst = arg.split(':') srcdst = arg.split(':')
if len(srcdst) != 2: if len(srcdst) != 2:
...@@ -812,7 +819,7 @@ def main(builder=None): ...@@ -812,7 +819,7 @@ def main(builder=None):
elif opt == '--iconfile': elif opt == '--iconfile':
builder.iconfile = arg builder.iconfile = arg
elif opt == "--lib": elif opt == "--lib":
builder.libs.append(arg) builder.libs.append(os.path.normpath(arg))
elif opt == "--nib": elif opt == "--nib":
builder.nibname = arg builder.nibname = arg
elif opt in ('-p', '--plist'): elif opt in ('-p', '--plist'):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment