diff options
author | Steve Dower <steve.dower@microsoft.com> | 2016-07-16 23:13:19 (GMT) |
---|---|---|
committer | Steve Dower <steve.dower@microsoft.com> | 2016-07-16 23:13:19 (GMT) |
commit | 6fd76bceda3fefc5e5814108c5fe819050613d33 (patch) | |
tree | f8acf1d6f83647788e50ca1ad2b530b1a4f33560 /Tools/msi/make_zip.py | |
parent | ff1d5ab16e6424cf000be314e3c5ca8e42ae43f4 (diff) | |
download | cpython-6fd76bceda3fefc5e5814108c5fe819050613d33.zip cpython-6fd76bceda3fefc5e5814108c5fe819050613d33.tar.gz cpython-6fd76bceda3fefc5e5814108c5fe819050613d33.tar.bz2 |
Fixes use of Py_IntDir and Py_OutDir to control build directories.
Diffstat (limited to 'Tools/msi/make_zip.py')
-rw-r--r-- | Tools/msi/make_zip.py | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Tools/msi/make_zip.py b/Tools/msi/make_zip.py index de978ba..0e8a4a6 100644 --- a/Tools/msi/make_zip.py +++ b/Tools/msi/make_zip.py @@ -90,23 +90,23 @@ def include_in_tools(p): return p.suffix.lower() in {'.py', '.pyw', '.txt'} FULL_LAYOUT = [ - ('/', 'PCBuild/$arch', 'python.exe', is_not_debug), - ('/', 'PCBuild/$arch', 'pythonw.exe', is_not_debug), - ('/', 'PCBuild/$arch', 'python{0.major}.dll'.format(sys.version_info), is_not_debug), - ('/', 'PCBuild/$arch', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug), - ('DLLs/', 'PCBuild/$arch', '*.pyd', is_not_debug), - ('DLLs/', 'PCBuild/$arch', '*.dll', is_not_debug_or_python), + ('/', '$build', 'python.exe', is_not_debug), + ('/', '$build', 'pythonw.exe', is_not_debug), + ('/', '$build', 'python{0.major}.dll'.format(sys.version_info), is_not_debug), + ('/', '$build', 'python{0.major}{0.minor}.dll'.format(sys.version_info), is_not_debug), + ('DLLs/', '$build', '*.pyd', is_not_debug), + ('DLLs/', '$build', '*.dll', is_not_debug_or_python), ('include/', 'include', '*.h', None), ('include/', 'PC', 'pyconfig.h', None), ('Lib/', 'Lib', '**/*', include_in_lib), - ('libs/', 'PCBuild/$arch', '*.lib', include_in_libs), + ('libs/', '$build', '*.lib', include_in_libs), ('Tools/', 'Tools', '**/*', include_in_tools), ] EMBED_LAYOUT = [ - ('/', 'PCBuild/$arch', 'python*.exe', is_not_debug), - ('/', 'PCBuild/$arch', '*.pyd', is_not_debug), - ('/', 'PCBuild/$arch', '*.dll', is_not_debug), + ('/', '$build', 'python*.exe', is_not_debug), + ('/', '$build', '*.pyd', is_not_debug), + ('/', '$build', '*.dll', is_not_debug), ('python{0.major}{0.minor}.zip'.format(sys.version_info), 'Lib', '**/*', include_in_lib), ] @@ -168,18 +168,18 @@ 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('-a', '--arch', help='Specify the architecture to use (win32/amd64)', type=str, default="win32") + parser.add_argument('-b', '--build', help='Specify the build directory', type=Path) ns = parser.parse_args() source = ns.source or (Path(__file__).resolve().parent.parent.parent) out = ns.out - arch = ns.arch + build = ns.build assert isinstance(source, Path) assert not out or isinstance(out, Path) - assert isinstance(arch, str) + assert isinstance(build, Path) if ns.temp: temp = ns.temp @@ -202,7 +202,10 @@ def main(): try: for t, s, p, c in layout: - s = source / s.replace("$arch", arch) + if s == '$build': + s = build + else: + s = source / s copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c)) print('Copied {} files'.format(copied)) |