Kaydet (Commit) 8c1cee92 authored tarafından Steve Dower's avatar Steve Dower

Replaces use of WinRAR to generate ZIP file with Python script

üst 88abdef0
...@@ -64,13 +64,6 @@ for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf ...@@ -64,13 +64,6 @@ for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf
set _DLLTOOL_PATH= set _DLLTOOL_PATH=
:skipdlltoolsearch :skipdlltoolsearch
where rar /q && goto skiprarsearch
set _RAR_PATH=
where /R "%ProgramFiles%\WinRAR" rar > "%TEMP%\rar.loc" 2> nul && set /P _RAR_PATH= < "%TEMP%\rar.loc" & del "%TEMP%\rar.loc"
where /R "%ProgramFiles(x86)%\WinRAR" rar > "%TEMP%\rar.loc" 2> nul && set /P _RAR_PATH= < "%TEMP%\rar.loc" & del "%TEMP%\rar.loc"
if not exist "%_RAR_PATH%" echo Cannot find WinRAR on PATH or in external && pause
:skiprarsearch
if defined BUILDX86 ( if defined BUILDX86 (
call :build x86 call :build x86
if errorlevel 1 exit /B if errorlevel 1 exit /B
...@@ -142,7 +135,7 @@ if errorlevel 1 exit /B ...@@ -142,7 +135,7 @@ if errorlevel 1 exit /B
msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
if errorlevel 1 exit /B if errorlevel 1 exit /B
if defined _RAR_PATH msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% "/p:RAR=%_RAR_PATH%" msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%
if not "%OUTDIR%" EQU "" ( if not "%OUTDIR%" EQU "" (
mkdir "%OUTDIR%\%OUTDIR_PLAT%" mkdir "%OUTDIR%\%OUTDIR_PLAT%"
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
<TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath> <TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
<Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments> <Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName)</Arguments> <Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -a $(ArchName)</Arguments>
<Arguments Condition="Exists('$(RAR)')">$(Arguments) --rar "$(RAR)"</Arguments>
<Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment> <Environment>set DOC_FILENAME=python$(PythonVersion).chm</Environment>
</PropertyGroup> </PropertyGroup>
......
...@@ -72,7 +72,7 @@ EMBED_LAYOUT = [ ...@@ -72,7 +72,7 @@ EMBED_LAYOUT = [
('python35.zip', 'Lib', '**/*', include_in_lib), ('python35.zip', 'Lib', '**/*', include_in_lib),
] ]
def copy_to_layout(target, source, rel_sources): def copy_to_layout(target, rel_sources):
count = 0 count = 0
if target.suffix.lower() == '.zip': if target.suffix.lower() == '.zip':
...@@ -146,21 +146,11 @@ def main(): ...@@ -146,21 +146,11 @@ def main():
try: try:
for t, s, p, c in layout: for t, s, p, c in layout:
s = source / s.replace("$arch", arch) s = source / s.replace("$arch", arch)
copied = copy_to_layout( copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c))
temp / t.rstrip('/'),
source,
rglob(s, p, c)
)
print('Copied {} files'.format(copied)) print('Copied {} files'.format(copied))
if rar and rar.is_file(): total = copy_to_layout(out, rglob(temp, '*', None))
subprocess.check_call([ print('Wrote {} files to {}'.format(total, out))
str(rar),
"a",
"-ed", "-ep1", "-s", "-r",
str(out),
str(temp / '*')
])
finally: finally:
if delete_temp: if delete_temp:
shutil.rmtree(temp, True) shutil.rmtree(temp, True)
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
<File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu"> <File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu">
<CopyTo>$(MSITarget)</CopyTo> <CopyTo>$(MSITarget)</CopyTo>
</File> </File>
<File Include="$(OutputPath)\*.exe"> <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip">
<CopyTo>$(EXETarget)</CopyTo> <CopyTo>$(EXETarget)</CopyTo>
</File> </File>
<File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)"> <File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment