mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
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.
This commit is contained in:
parent
be95462c1c
commit
c77f6dfd92
4 changed files with 28 additions and 11 deletions
|
@ -60,7 +60,7 @@ def findtemplate(template=None):
|
||||||
return file
|
return file
|
||||||
|
|
||||||
def process(template, filename, destname, copy_codefragment=0,
|
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":
|
if progress == "default":
|
||||||
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
|
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:
|
except os.error:
|
||||||
pass
|
pass
|
||||||
process_common(template, progress, code, rsrcname, destname, 0,
|
process_common(template, progress, code, rsrcname, destname, 0,
|
||||||
copy_codefragment, raw, others, filename)
|
copy_codefragment, raw, others, filename, destroot)
|
||||||
|
|
||||||
|
|
||||||
def update(template, filename, output):
|
def update(template, filename, output):
|
||||||
|
@ -130,10 +130,10 @@ def update(template, filename, output):
|
||||||
|
|
||||||
|
|
||||||
def process_common(template, progress, code, rsrcname, destname, is_update,
|
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':
|
if MacOS.runtimemodel == 'macho':
|
||||||
return process_common_macho(template, progress, code, rsrcname, destname,
|
return process_common_macho(template, progress, code, rsrcname, destname,
|
||||||
is_update, raw, others, filename)
|
is_update, raw, others, filename, destroot)
|
||||||
if others:
|
if others:
|
||||||
raise BuildError, "Extra files only allowed for MachoPython applets"
|
raise BuildError, "Extra files only allowed for MachoPython applets"
|
||||||
# Create FSSpecs for the various files
|
# Create FSSpecs for the various files
|
||||||
|
@ -265,7 +265,7 @@ def process_common(template, progress, code, rsrcname, destname, is_update,
|
||||||
progress.inc(0)
|
progress.inc(0)
|
||||||
|
|
||||||
def process_common_macho(template, progress, code, rsrcname, destname, is_update,
|
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
|
# Check that we have a filename
|
||||||
if filename is None:
|
if filename is None:
|
||||||
raise BuildError, "Need source filename on MacOSX"
|
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.mainprogram = filename
|
||||||
builder.builddir = destdir
|
builder.builddir = destdir
|
||||||
builder.name = shortname
|
builder.name = shortname
|
||||||
|
builder.destroot = destroot
|
||||||
if rsrcname:
|
if rsrcname:
|
||||||
realrsrcname = macresource.resource_pathname(rsrcname)
|
realrsrcname = macresource.resource_pathname(rsrcname)
|
||||||
builder.files.append((realrsrcname,
|
builder.files.append((realrsrcname,
|
||||||
|
|
|
@ -110,6 +110,9 @@ class BundleBuilder(Defaults):
|
||||||
|
|
||||||
# Verbosity level.
|
# Verbosity level.
|
||||||
verbosity = 1
|
verbosity = 1
|
||||||
|
|
||||||
|
# Destination root directory
|
||||||
|
destroot = ""
|
||||||
|
|
||||||
def setup(self):
|
def setup(self):
|
||||||
# XXX rethink self.name munging, this is brittle.
|
# XXX rethink self.name munging, this is brittle.
|
||||||
|
@ -445,7 +448,7 @@ class AppBuilder(BundleBuilder):
|
||||||
execname = os.path.basename(self.executable)
|
execname = os.path.basename(self.executable)
|
||||||
execpath = pathjoin(self.execdir, execname)
|
execpath = pathjoin(self.execdir, execname)
|
||||||
if not self.symlink_exec:
|
if not self.symlink_exec:
|
||||||
self.files.append((self.executable, execpath))
|
self.files.append((self.destroot + self.executable, execpath))
|
||||||
self.execpath = execpath
|
self.execpath = execpath
|
||||||
|
|
||||||
if self.mainprogram is not None:
|
if self.mainprogram is not None:
|
||||||
|
@ -828,7 +831,7 @@ def main(builder=None):
|
||||||
"mainprogram=", "creator=", "nib=", "plist=", "link",
|
"mainprogram=", "creator=", "nib=", "plist=", "link",
|
||||||
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
|
"link-exec", "help", "verbose", "quiet", "argv", "standalone",
|
||||||
"exclude=", "include=", "package=", "strip", "iconfile=",
|
"exclude=", "include=", "package=", "strip", "iconfile=",
|
||||||
"lib=", "python=", "semi-standalone", "bundle-id=")
|
"lib=", "python=", "semi-standalone", "bundle-id=", "destroot=")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
|
options, args = getopt.getopt(sys.argv[1:], shortopts, longopts)
|
||||||
|
@ -890,6 +893,8 @@ def main(builder=None):
|
||||||
builder.includePackages.append(arg)
|
builder.includePackages.append(arg)
|
||||||
elif opt == '--strip':
|
elif opt == '--strip':
|
||||||
builder.strip = 1
|
builder.strip = 1
|
||||||
|
elif opt == '--destroot':
|
||||||
|
builder.destroot = arg
|
||||||
|
|
||||||
if len(args) != 1:
|
if len(args) != 1:
|
||||||
usage("Must specify one command ('build', 'report' or 'help')")
|
usage("Must specify one command ('build', 'report' or 'help')")
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# main Makefile. The next couple of variables are overridden on the
|
# main Makefile. The next couple of variables are overridden on the
|
||||||
# commandline in that case.
|
# commandline in that case.
|
||||||
|
|
||||||
VERSION=2.4
|
VERSION=2.5
|
||||||
builddir = ../..
|
builddir = ../..
|
||||||
srcdir = ../..
|
srcdir = ../..
|
||||||
prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
|
prefix=/Library/Frameworks/Python.framework/Versions/$(VERSION)
|
||||||
|
@ -120,10 +120,12 @@ install_IDE:
|
||||||
echo See Mac/OSX/README for details; \
|
echo See Mac/OSX/README for details; \
|
||||||
else \
|
else \
|
||||||
echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
--output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
||||||
$(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py ; \
|
||||||
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
--output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/PythonIDE.app --noargv \
|
||||||
$(srcdir)/Mac/Tools/IDE/PythonIDE.py; \
|
$(srcdir)/Mac/Tools/IDE/PythonIDE.py; \
|
||||||
|
@ -136,6 +138,7 @@ install_PackageManager:
|
||||||
else \
|
else \
|
||||||
echo $(BUILDPYTHON) $(bundlebuilder) \
|
echo $(BUILDPYTHON) $(bundlebuilder) \
|
||||||
--builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \
|
--builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
||||||
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
||||||
|
@ -143,6 +146,7 @@ install_PackageManager:
|
||||||
--creator Pimp build; \
|
--creator Pimp build; \
|
||||||
$(BUILDPYTHON) $(bundlebuilder) \
|
$(BUILDPYTHON) $(bundlebuilder) \
|
||||||
--builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \
|
--builddir $(DESTDIR)$(PYTHONAPPSDIR)/ \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
--resource $(srcdir)/Mac/Tools/IDE/PythonIDE.rsrc \
|
||||||
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
--mainprogram $(srcdir)/Mac/Tools/IDE/PackageManager.py \
|
||||||
|
@ -157,11 +161,13 @@ install_IDLE:
|
||||||
else \
|
else \
|
||||||
echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
echo $(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \
|
||||||
--extra $(srcdir)/Lib/idlelib \
|
--extra $(srcdir)/Lib/idlelib \
|
||||||
$(srcdir)/Tools/scripts/idle ; \
|
$(srcdir)/Tools/scripts/idle ; \
|
||||||
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/IDLE.app \
|
||||||
--extra $(srcdir)/Lib/idlelib:Contents/Resources/idlelib \
|
--extra $(srcdir)/Lib/idlelib:Contents/Resources/idlelib \
|
||||||
$(srcdir)/Tools/scripts/idle ; \
|
$(srcdir)/Tools/scripts/idle ; \
|
||||||
|
@ -170,6 +176,7 @@ install_IDLE:
|
||||||
|
|
||||||
install_BuildApplet:
|
install_BuildApplet:
|
||||||
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
$(BUILDPYTHON) $(srcdir)/Mac/scripts/BuildApplet.py \
|
||||||
|
--destroot $(DESTDIR) \
|
||||||
--python $(INSTALLED_PYTHONW) \
|
--python $(INSTALLED_PYTHONW) \
|
||||||
--output $(DESTDIR)$(PYTHONAPPSDIR)/BuildApplet.app \
|
--output $(DESTDIR)$(PYTHONAPPSDIR)/BuildApplet.app \
|
||||||
$(srcdir)/Mac/scripts/BuildApplet.py
|
$(srcdir)/Mac/scripts/BuildApplet.py
|
||||||
|
|
|
@ -53,8 +53,8 @@ def buildapplet():
|
||||||
buildtools.process(template, filename, dstfilename, 1)
|
buildtools.process(template, filename, dstfilename, 1)
|
||||||
else:
|
else:
|
||||||
|
|
||||||
SHORTOPTS = "o:r:ne:v?P"
|
SHORTOPTS = "o:r:ne:v?PR"
|
||||||
LONGOPTS=("output=", "resource=", "noargv", "extra=", "verbose", "help", "python=")
|
LONGOPTS=("output=", "resource=", "noargv", "extra=", "verbose", "help", "python=", "destroot=")
|
||||||
try:
|
try:
|
||||||
options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS)
|
options, args = getopt.getopt(sys.argv[1:], SHORTOPTS, LONGOPTS)
|
||||||
except getopt.error:
|
except getopt.error:
|
||||||
|
@ -67,6 +67,7 @@ def buildapplet():
|
||||||
raw = 0
|
raw = 0
|
||||||
extras = []
|
extras = []
|
||||||
verbose = None
|
verbose = None
|
||||||
|
destroot = ''
|
||||||
for opt, arg in options:
|
for opt, arg in options:
|
||||||
if opt in ('-o', '--output'):
|
if opt in ('-o', '--output'):
|
||||||
dstfilename = arg
|
dstfilename = arg
|
||||||
|
@ -87,6 +88,8 @@ def buildapplet():
|
||||||
verbose = Verbose()
|
verbose = Verbose()
|
||||||
elif opt in ('-?', '--help'):
|
elif opt in ('-?', '--help'):
|
||||||
usage()
|
usage()
|
||||||
|
elif opt in ('-d', '--destroot'):
|
||||||
|
destroot = arg
|
||||||
# On OS9 always be verbose
|
# On OS9 always be verbose
|
||||||
if sys.platform == 'mac' and not verbose:
|
if sys.platform == 'mac' and not verbose:
|
||||||
verbose = 'default'
|
verbose = 'default'
|
||||||
|
@ -97,7 +100,8 @@ def buildapplet():
|
||||||
buildtools.update(template, filename, dstfilename)
|
buildtools.update(template, filename, dstfilename)
|
||||||
else:
|
else:
|
||||||
buildtools.process(template, filename, dstfilename, 1,
|
buildtools.process(template, filename, dstfilename, 1,
|
||||||
rsrcname=rsrcfilename, others=extras, raw=raw, progress=verbose)
|
rsrcname=rsrcfilename, others=extras, raw=raw,
|
||||||
|
progress=verbose, destroot=destroot)
|
||||||
|
|
||||||
def usage():
|
def usage():
|
||||||
print "BuildApplet creates an application from a Python source file"
|
print "BuildApplet creates an application from a Python source file"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue