From: Steve Dower Date: Wed, 23 Nov 2016 19:42:35 +0000 (-0800) Subject: Issue #28783: Embedded and nuget packages incorrect reference missing bdist_wininst... X-Git-Tag: v3.6.0rc1~35 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2a94301911e665bfa85e0976f72bd48dca52af15;p=thirdparty%2FPython%2Fcpython.git Issue #28783: Embedded and nuget packages incorrect reference missing bdist_wininst command. --- 2a94301911e665bfa85e0976f72bd48dca52af15 diff --cc Tools/msi/make_zip.py index f070cb91a958,460cd5bff32b..09f6fe328f3d --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@@ -42,6 -42,6 +43,7 @@@ EXCLUDE_FILE_FROM_LIBRARY = } EXCLUDE_FILE_FROM_LIBS = { ++ 'liblzma', 'ssleay', 'libeay', 'python3stub', @@@ -173,10 -173,10 +179,10 @@@ def rglob(root, pattern, condition) def main(): parser = argparse.ArgumentParser() parser.add_argument('-s', '--source', metavar='dir', help='The directory containing the repository root', type=Path) - parser.add_argument('-o', '--out', metavar='file', help='The name of the output self-extracting archive', type=Path, default=None) + parser.add_argument('-o', '--out', metavar='file', help='The name of the output archive', type=Path, default=None) parser.add_argument('-t', '--temp', metavar='dir', help='A directory to temporarily extract files into', type=Path, default=None) parser.add_argument('-e', '--embed', help='Create an embedding layout', action='store_true', default=False) - parser.add_argument('-b', '--build', help='Specify the build directory', type=Path) + parser.add_argument('-a', '--arch', help='Specify the architecture to use (win32/amd64)', type=str, default="win32") ns = parser.parse_args() source = ns.source or (Path(__file__).resolve().parent.parent.parent) @@@ -207,17 -207,22 +213,24 @@@ try: for t, s, p, c in layout: - s = source / s.replace("$arch", arch) - copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c)) - if s == '$build': - fs = build - else: - fs = source / s ++ fs = source / s.replace("$arch", arch) + 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: - print('applocal = true', file=f) + if ns.embed: + with open(str(temp / (BASE_NAME + '._pth')), 'w') as f: + print(BASE_NAME + '.zip', file=f) + print('.', file=f) + print('', file=f) + print('# Uncomment to run site.main() automatically', file=f) + print('#import site', file=f) if out: total = copy_to_layout(out, rglob(temp, '**/*', None))