#22398 Tools/msi enhancements for 2.7

Fix build_tkinter.py.
Update msi.py to use environment vars and correct tcl/tk paths.
Update msilib.py to generate short names for files with multiple dots in the name.
This commit is contained in:
Steve Dower 2014-09-12 11:48:13 -07:00
parent bf8b0ed5cb
commit 144de3152d
3 changed files with 9 additions and 14 deletions

View File

@ -23,7 +23,7 @@ NMAKE = ('nmake /nologo /f %s '
'%s %s') '%s %s')
def nmake(makefile, command="", **kw): def nmake(makefile, command="", **kw):
defines = ' '.join(k+'='+v for k, v in kw.items()) defines = ' '.join('%s=%s' % i for i in kw.items())
cmd = NMAKE % (makefile, defines, command) cmd = NMAKE % (makefile, defines, command)
print("\n\n"+cmd+"\n") print("\n\n"+cmd+"\n")
if os.system(cmd) != 0: if os.system(cmd) != 0:

View File

@ -13,7 +13,7 @@ import tempfile
# 0 for official python.org releases # 0 for official python.org releases
# 1 for intermediate releases by anybody, with # 1 for intermediate releases by anybody, with
# a new product code for every package. # a new product code for every package.
snapshot = 1 snapshot = int(os.environ.get("SNAPSHOT", "1"))
# 1 means that file extension is px, not py, # 1 means that file extension is px, not py,
# and binaries start with x # and binaries start with x
testpackage = 0 testpackage = 0
@ -22,15 +22,15 @@ srcdir = os.path.abspath("../..")
# Text to be displayed as the version in dialogs etc. # Text to be displayed as the version in dialogs etc.
# goes into file name and ProductCode. Defaults to # goes into file name and ProductCode. Defaults to
# current_version.day for Snapshot, current_version otherwise # current_version.day for Snapshot, current_version otherwise
full_current_version = None full_current_version = os.environ.get("CURRENT_VERSION")
# Is Tcl available at all? # Is Tcl available at all?
have_tcl = True have_tcl = True
# path to PCbuild directory # path to PCbuild directory
PCBUILD="PCbuild" PCBUILD=os.environ.get("PCBUILD", "PCbuild")
# msvcrt version # msvcrt version
MSVCR = "90" MSVCR = "90"
# Name of certificate in default store to sign MSI with # Name of certificate in default store to sign MSI with
certname = None certname = os.environ.get("CERTNAME", None)
# Make a zip file containing the PDB files for this build? # Make a zip file containing the PDB files for this build?
pdbzip = True pdbzip = True
@ -894,8 +894,8 @@ def generate_license():
for name, pat, file in (("bzip2","bzip2-*", "LICENSE"), for name, pat, file in (("bzip2","bzip2-*", "LICENSE"),
("Berkeley DB", "db-*", "LICENSE"), ("Berkeley DB", "db-*", "LICENSE"),
("openssl", "openssl-*", "LICENSE"), ("openssl", "openssl-*", "LICENSE"),
("Tcl", "tcl8*", "license.terms"), ("Tcl", "tcl-8*", "license.terms"),
("Tk", "tk8*", "license.terms"), ("Tk", "tk-8*", "license.terms"),
("Tix", "tix-*", "license.terms")): ("Tix", "tix-*", "license.terms")):
out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % name) out.write("\nThis copy of Python includes a copy of %s, which is licensed under the following terms:\n\n" % name)
dirs = glob.glob(srcdir+"/../"+pat) dirs = glob.glob(srcdir+"/../"+pat)
@ -946,7 +946,7 @@ def add_files(db):
if not snapshot: if not snapshot:
# For releases, the Python DLL has the same version as the # For releases, the Python DLL has the same version as the
# installer package. # installer package.
assert pyversion.split(".")[:3] == current_version.split(".") assert pyversion.split(".")[:3] == current_version.split("."), "%s != %s" % (pyversion, current_version)
dlldir.add_file("%s/python%s%s.dll" % (PCBUILD, major, minor), dlldir.add_file("%s/python%s%s.dll" % (PCBUILD, major, minor),
version=pyversion, version=pyversion,
language=installer.FileVersion(pydllsrc, 1)) language=installer.FileVersion(pydllsrc, 1))

View File

@ -484,12 +484,7 @@ class Directory:
def make_short(self, file): def make_short(self, file):
file = re.sub(r'[\?|><:/*"+,;=\[\]]', '_', file) # restrictions on short names file = re.sub(r'[\?|><:/*"+,;=\[\]]', '_', file) # restrictions on short names
parts = file.split(".") prefix, _, suffix = file.upper().rpartition(".")
if len(parts)>1:
suffix = parts[-1].upper()
else:
suffix = None
prefix = parts[0].upper()
if len(prefix) <= 8 and (not suffix or len(suffix)<=3): if len(prefix) <= 8 and (not suffix or len(suffix)<=3):
if suffix: if suffix:
file = prefix+"."+suffix file = prefix+"."+suffix