@@ -90,23 +90,23 @@ def include_in_tools(p):
9090 return p .suffix .lower () in {'.py' , '.pyw' , '.txt' }
9191
9292FULL_LAYOUT = [
93- ('/' , 'PCBuild/$arch ' , 'python.exe' , is_not_debug ),
94- ('/' , 'PCBuild/$arch ' , 'pythonw.exe' , is_not_debug ),
95- ('/' , 'PCBuild/$arch ' , 'python{0.major}.dll' .format (sys .version_info ), is_not_debug ),
96- ('/' , 'PCBuild/$arch ' , 'python{0.major}{0.minor}.dll' .format (sys .version_info ), is_not_debug ),
97- ('DLLs/' , 'PCBuild/$arch ' , '*.pyd' , is_not_debug ),
98- ('DLLs/' , 'PCBuild/$arch ' , '*.dll' , is_not_debug_or_python ),
93+ ('/' , '$build ' , 'python.exe' , is_not_debug ),
94+ ('/' , '$build ' , 'pythonw.exe' , is_not_debug ),
95+ ('/' , '$build ' , 'python{0.major}.dll' .format (sys .version_info ), is_not_debug ),
96+ ('/' , '$build ' , 'python{0.major}{0.minor}.dll' .format (sys .version_info ), is_not_debug ),
97+ ('DLLs/' , '$build ' , '*.pyd' , is_not_debug ),
98+ ('DLLs/' , '$build ' , '*.dll' , is_not_debug_or_python ),
9999 ('include/' , 'include' , '*.h' , None ),
100100 ('include/' , 'PC' , 'pyconfig.h' , None ),
101101 ('Lib/' , 'Lib' , '**/*' , include_in_lib ),
102- ('libs/' , 'PCBuild/$arch ' , '*.lib' , include_in_libs ),
102+ ('libs/' , '$build ' , '*.lib' , include_in_libs ),
103103 ('Tools/' , 'Tools' , '**/*' , include_in_tools ),
104104]
105105
106106EMBED_LAYOUT = [
107- ('/' , 'PCBuild/$arch ' , 'python*.exe' , is_not_debug ),
108- ('/' , 'PCBuild/$arch ' , '*.pyd' , is_not_debug ),
109- ('/' , 'PCBuild/$arch ' , '*.dll' , is_not_debug ),
107+ ('/' , '$build ' , 'python*.exe' , is_not_debug ),
108+ ('/' , '$build ' , '*.pyd' , is_not_debug ),
109+ ('/' , '$build ' , '*.dll' , is_not_debug ),
110110 ('python{0.major}{0.minor}.zip' .format (sys .version_info ), 'Lib' , '**/*' , include_in_lib ),
111111]
112112
@@ -168,18 +168,18 @@ def rglob(root, pattern, condition):
168168def main ():
169169 parser = argparse .ArgumentParser ()
170170 parser .add_argument ('-s' , '--source' , metavar = 'dir' , help = 'The directory containing the repository root' , type = Path )
171- parser .add_argument ('-o' , '--out' , metavar = 'file' , help = 'The name of the output self-extracting archive' , type = Path , default = None )
171+ parser .add_argument ('-o' , '--out' , metavar = 'file' , help = 'The name of the output archive' , type = Path , default = None )
172172 parser .add_argument ('-t' , '--temp' , metavar = 'dir' , help = 'A directory to temporarily extract files into' , type = Path , default = None )
173173 parser .add_argument ('-e' , '--embed' , help = 'Create an embedding layout' , action = 'store_true' , default = False )
174- parser .add_argument ('-a ' , '--arch ' , help = 'Specify the architecture to use (win32/amd64) ' , type = str , default = "win32" )
174+ parser .add_argument ('-b ' , '--build ' , help = 'Specify the build directory ' , type = Path )
175175 ns = parser .parse_args ()
176176
177177 source = ns .source or (Path (__file__ ).resolve ().parent .parent .parent )
178178 out = ns .out
179- arch = ns .arch
179+ build = ns .build
180180 assert isinstance (source , Path )
181181 assert not out or isinstance (out , Path )
182- assert isinstance (arch , str )
182+ assert isinstance (build , Path )
183183
184184 if ns .temp :
185185 temp = ns .temp
@@ -202,7 +202,10 @@ def main():
202202
203203 try :
204204 for t , s , p , c in layout :
205- s = source / s .replace ("$arch" , arch )
205+ if s == '$build' :
206+ s = build
207+ else :
208+ s = source / s
206209 copied = copy_to_layout (temp / t .rstrip ('/' ), rglob (s , p , c ))
207210 print ('Copied {} files' .format (copied ))
208211
0 commit comments