diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-11-23 18:23:47 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-11-23 18:23:47 (GMT) |
commit | f0888cd7340c3b714c8ec4540db652f8c30b9011 (patch) | |
tree | 0b9784305a8c6a04e0434ab2de2758278d560dcb /Tools/msi | |
parent | dab05847385c14fe76773d30f75f2bdc5b2ab7e3 (diff) | |
download | cpython-f0888cd7340c3b714c8ec4540db652f8c30b9011.zip cpython-f0888cd7340c3b714c8ec4540db652f8c30b9011.tar.gz cpython-f0888cd7340c3b714c8ec4540db652f8c30b9011.tar.bz2 |
Issue #28783: Embedded and nuget packages incorrect reference missing bdist_wininst command.
Diffstat (limited to 'Tools/msi')
-rw-r--r-- | Tools/msi/distutils.command.__init__.py | 32 | ||||
-rw-r--r-- | Tools/msi/make_zip.py | 18 |
2 files changed, 47 insertions, 3 deletions
diff --git a/Tools/msi/distutils.command.__init__.py b/Tools/msi/distutils.command.__init__.py new file mode 100644 index 0000000..83f34b4 --- /dev/null +++ b/Tools/msi/distutils.command.__init__.py @@ -0,0 +1,32 @@ +"""distutils.command + +Package containing implementation of all the standard Distutils +commands.""" + +__all__ = ['build', + 'build_py', + 'build_ext', + 'build_clib', + 'build_scripts', + 'clean', + 'install', + 'install_lib', + 'install_headers', + 'install_scripts', + 'install_data', + 'sdist', + 'register', + 'bdist', + 'bdist_dumb', + 'bdist_rpm', + # This command is not included in this package + #'bdist_wininst', + 'check', + 'upload', + # These two are reserved for future use: + #'bdist_sdux', + #'bdist_pkgtool', + # Note: + # bdist_packager is not included because it only provides + # an abstract base class + ] diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index 0e8a4a6..460cd5b 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -7,6 +7,7 @@ import stat import os import tempfile +from itertools import chain from pathlib import Path from zipfile import ZipFile, ZIP_DEFLATED import subprocess @@ -74,6 +75,10 @@ def include_in_lib(p): if name in EXCLUDE_FILE_FROM_LIBRARY: return False + # Special code is included below to patch this file back in + if [d.lower() for d in p.parts[-3:]] == ['distutils', 'command', '__init__.py']: + return False + suffix = p.suffix.lower() return suffix not in {'.pyc', '.pyo', '.exe'} @@ -203,10 +208,17 @@ def main(): try: for t, s, p, c in layout: if s == '$build': - s = build + fs = build else: - s = source / s - copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c)) + fs = source / s + files = rglob(fs, p, c) + extra_files = [] + if s == 'Lib' and p == '**/*': + extra_files.append(( + source / 'tools' / 'msi' / 'distutils.command.__init__.py', + Path('distutils') / 'command' / '__init__.py' + )) + copied = copy_to_layout(temp / t.rstrip('/'), chain(files, extra_files)) print('Copied {} files'.format(copied)) with open(str(temp / 'pyvenv.cfg'), 'w') as f: |