summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2004-12-27 15:51:03 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2004-12-27 15:51:03 (GMT)
commitc77f6dfd923e469cd645a0f825509cf0e9c490a0 (patch)
tree2b344911d47fe753c76922eed65eb86b0c9235fa /Lib/plat-mac
parentbe95462c1c2955a9e41d754e7ebe9f825c980409 (diff)
downloadcpython-c77f6dfd923e469cd645a0f825509cf0e9c490a0.zip
cpython-c77f6dfd923e469cd645a0f825509cf0e9c490a0.tar.gz
cpython-c77f6dfd923e469cd645a0f825509cf0e9c490a0.tar.bz2
Fix for #1091468: DESTROOTed frameworkinstalls fail. Added a --destroot
option to various tools, and do the right thing when we're doing a destroot install. Will backport to 2.4 and 2.3.
Diffstat (limited to 'Lib/plat-mac')
-rw-r--r--Lib/plat-mac/buildtools.py11
-rwxr-xr-xLib/plat-mac/bundlebuilder.py9
2 files changed, 13 insertions, 7 deletions
diff --git a/Lib/plat-mac/buildtools.py b/Lib/plat-mac/buildtools.py
index 17e4076..c83e218 100644
--- a/Lib/plat-mac/buildtools.py
+++ b/Lib/plat-mac/buildtools.py
@@ -60,7 +60,7 @@ def findtemplate(template=None):
return file
def process(template, filename, destname, copy_codefragment=0,
- rsrcname=None, others=[], raw=0, progress="default"):
+ rsrcname=None, others=[], raw=0, progress="default", destroot=""):
if progress == "default":
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
@@ -108,7 +108,7 @@ def process(template, filename, destname, copy_codefragment=0,
except os.error:
pass
process_common(template, progress, code, rsrcname, destname, 0,
- copy_codefragment, raw, others, filename)
+ copy_codefragment, raw, others, filename, destroot)
def update(template, filename, output):
@@ -130,10 +130,10 @@ def update(template, filename, output):
def process_common(template, progress, code, rsrcname, destname, is_update,
- copy_codefragment, raw=0, others=[], filename=None):
+ copy_codefragment, raw=0, others=[], filename=None, destroot=""):
if MacOS.runtimemodel == 'macho':
return process_common_macho(template, progress, code, rsrcname, destname,
- is_update, raw, others, filename)
+ is_update, raw, others, filename, destroot)
if others:
raise BuildError, "Extra files only allowed for MachoPython applets"
# Create FSSpecs for the various files
@@ -265,7 +265,7 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
progress.inc(0)
def process_common_macho(template, progress, code, rsrcname, destname, is_update,
- raw=0, others=[], filename=None):
+ raw=0, others=[], filename=None, destroot=""):
# Check that we have a filename
if filename is None:
raise BuildError, "Need source filename on MacOSX"
@@ -302,6 +302,7 @@ def process_common_macho(template, progress, code, rsrcname, destname, is_update
builder.mainprogram = filename
builder.builddir = destdir
builder.name = shortname
+ builder.destroot = destroot
if rsrcname:
realrsrcname = macresource.resource_pathname(rsrcname)
builder.files.append((realrsrcname,
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index 09b9dea..e379544 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -110,6 +110,9 @@ class BundleBuilder(Defaults):
# Verbosity level.
verbosity = 1
+
+ # Destination root directory
+ destroot = ""
def setup(self):
# XXX rethink self.name munging, this is brittle.
@@ -445,7 +448,7 @@ class AppBuilder(BundleBuilder):
execname = os.path.basename(self.executable)
execpath = pathjoin(self.execdir, execname)
if not self.symlink_exec:
- self.files.append((self.executable, execpath))
+ self.files.append((self.destroot + self.executable, execpath))
self.execpath = execpath
if self.mainprogram is not None:
@@ -828,7 +831,7 @@ def main(builder=None):
"mainprogram=", "creator=", "nib=", "plist=", "link",
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
"exclude=", "include=", "package=", "strip", "iconfile=",
- "lib=", "python=", "semi-standalone", "bundle-id=")
+ "lib=", "python=", "semi-standalone", "bundle-id=", "destroot=")
try:
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
@@ -890,6 +893,8 @@ def main(builder=None):
builder.includePackages.append(arg)
elif opt == '--strip':
builder.strip = 1
+ elif opt == '--destroot':
+ builder.destroot = arg
if len(args) != 1:
usage("Must specify one command ('build', 'report' or 'help')")