]> granicus.if.org Git - python/commitdiff
Replaces use of WinRAR to generate ZIP file with Python script
authorSteve Dower <steve.dower@microsoft.com>
Sun, 3 May 2015 04:38:26 +0000 (21:38 -0700)
committerSteve Dower <steve.dower@microsoft.com>
Sun, 3 May 2015 04:38:26 +0000 (21:38 -0700)
Tools/msi/buildrelease.bat
Tools/msi/make_zip.proj
Tools/msi/make_zip.py
Tools/msi/uploadrelease.proj

index 21ce8631dada35dd5fa442fde093a35556662d4d..2e73f8fe7cf41f1a0280f22fa58e0261d00d3313 100644 (file)
@@ -64,13 +64,6 @@ for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf
 set _DLLTOOL_PATH=\r
 :skipdlltoolsearch\r
 \r
-where rar /q && goto skiprarsearch\r
-set _RAR_PATH=\r
-where /R "%ProgramFiles%\WinRAR" rar > "%TEMP%\rar.loc" 2> nul && set /P _RAR_PATH= < "%TEMP%\rar.loc" & del "%TEMP%\rar.loc" \r
-where /R "%ProgramFiles(x86)%\WinRAR" rar > "%TEMP%\rar.loc" 2> nul && set /P _RAR_PATH= < "%TEMP%\rar.loc" & del "%TEMP%\rar.loc" \r
-if not exist "%_RAR_PATH%" echo Cannot find WinRAR on PATH or in external && pause\r
-:skiprarsearch\r
-\r
 if defined BUILDX86 (\r
     call :build x86\r
     if errorlevel 1 exit /B\r
@@ -142,7 +135,7 @@ if errorlevel 1 exit /B
 msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false\r
 if errorlevel 1 exit /B\r
 \r
-if defined _RAR_PATH msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% "/p:RAR=%_RAR_PATH%"\r
+msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%\r
 \r
 if not "%OUTDIR%" EQU "" (\r
     mkdir "%OUTDIR%\%OUTDIR_PLAT%"\r
index a0f461a71dbed32c271d86b0734135f267ee49ee..4f9986ec0808cace02feb9335ac9f816b489181e 100644 (file)
@@ -15,7 +15,6 @@
         <TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
         <Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</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>
     </PropertyGroup>
 
index 368b4ec8f0403f47359344cbf53ebc41ad55e2b6..72ec280e57d00ad44b540dec1425e8c3d1cef8ba 100644 (file)
@@ -72,7 +72,7 @@ EMBED_LAYOUT = [
     ('python35.zip', 'Lib', '**/*', include_in_lib),
 ]
 
-def copy_to_layout(target, source, rel_sources):
+def copy_to_layout(target, rel_sources):
     count = 0
 
     if target.suffix.lower() == '.zip':
@@ -146,21 +146,11 @@ def main():
     try:
         for t, s, p, c in layout:
             s = source / s.replace("$arch", arch)
-            copied = copy_to_layout(
-                temp / t.rstrip('/'),
-                source,
-                rglob(s, p, c)
-            )
+            copied = copy_to_layout(temp / t.rstrip('/'), rglob(s, p, c))
             print('Copied {} files'.format(copied))
 
-        if rar and rar.is_file():
-            subprocess.check_call([
-                str(rar),
-                "a",
-                "-ed", "-ep1", "-s", "-r",
-                str(out),
-                str(temp / '*')
-            ])
+        total = copy_to_layout(out, rglob(temp, '*', None))
+        print('Wrote {} files to {}'.format(total, out))
     finally:
         if delete_temp:
             shutil.rmtree(temp, True)
index dea37566716e1dac142190040848c65fab5c2baf..ec4ede5950bb1aa157746d56ecea918679a70a14 100644 (file)
@@ -23,7 +23,7 @@
         <File Include="$(OutputPath)\*.msi;$(OutputPath)\*.msu">
             <CopyTo>$(MSITarget)</CopyTo>
         </File>
-        <File Include="$(OutputPath)\*.exe">
+        <File Include="$(OutputPath)\*.exe;$(OutputPath)\*.zip">
             <CopyTo>$(EXETarget)</CopyTo>
         </File>
         <File Include="$(PySourcePath)Doc\build\htmlhelp\python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm" Condition="$(IncludeDoc)">