summaryrefslogtreecommitdiff
path: root/PCbuild/get_externals.bat
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-03-12 11:15:15 +0200
committerSerhiy Storchaka <storchaka@gmail.com>2015-03-12 11:15:15 +0200
commitaef79164ae10e13c882ce2e10905809d16b85b09 (patch)
tree3ade3038667a84bfc33976d288b2edd951246b25 /PCbuild/get_externals.bat
parentf52cb397c583d106875f30d61ed323e50f18a389 (diff)
parent3d12c5b8e36f281af3dda150def4e1eb7a3b3269 (diff)
downloadcpython-aef79164ae10e13c882ce2e10905809d16b85b09.tar.gz
Issue #22928: Disabled HTTP header injections in http.client.
Original patch by Demian Brecht.
Diffstat (limited to 'PCbuild/get_externals.bat')
-rw-r--r--PCbuild/get_externals.bat103
1 files changed, 103 insertions, 0 deletions
diff --git a/PCbuild/get_externals.bat b/PCbuild/get_externals.bat
new file mode 100644
index 0000000000..e9987be3dd
--- /dev/null
+++ b/PCbuild/get_externals.bat
@@ -0,0 +1,103 @@
+@echo off
+setlocal
+rem Simple script to fetch source for external libraries
+
+if not exist "%~dp0..\externals" mkdir "%~dp0..\externals"
+pushd "%~dp0..\externals"
+
+if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
+
+rem Optionally clean up first. Be warned that this can be very destructive!
+if not "%1"=="" (
+ for %%c in (-c --clean --clean-only) do (
+ if "%1"=="%%c" goto clean
+ )
+ goto usage
+)
+goto fetch
+
+:clean
+echo.Cleaning up external libraries.
+for /D %%d in (
+ bzip2-*
+ db-*
+ nasm-*
+ openssl-*
+ tcl-*
+ tcltk*
+ tk-*
+ tix-*
+ sqlite-*
+ xz-*
+ ) do (
+ echo.Removing %%d
+ rmdir /s /q %%d
+)
+if "%1"=="--clean-only" (
+ goto end
+)
+
+:fetch
+rem Fetch current versions
+
+svn --version > nul 2>&1
+if ERRORLEVEL 9009 (
+ echo.svn.exe must be on your PATH.
+ echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
+ echo.command line tools option.
+ popd
+ exit /b 1
+)
+
+echo.Fetching external libraries...
+
+for %%e in (
+ bzip2-1.0.6
+ nasm-2.11.06
+ openssl-1.0.1l
+ tcl-core-8.6.3.1
+ tk-8.6.3.1
+ tix-8.4.3.4
+ sqlite-3.8.3.1
+ xz-5.0.5
+ ) do (
+ if exist %%e (
+ echo.%%e already exists, skipping.
+ ) else (
+ echo.Fetching %%e...
+ svn export %SVNROOT%%%e
+ )
+)
+
+goto end
+
+:usage
+echo.invalid argument: %1
+echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ]
+echo.
+echo.Pull all sources necessary for compiling optional extension modules
+echo.that rely on external libraries. Requires svn.exe to be on your PATH
+echo.and pulls sources from %SVNROOT%.
+echo.
+echo.Use the -c or --clean option to clean up all external library sources
+echo.before pulling in the current versions.
+echo.
+echo.Use the --clean-only option to do the same cleaning, without pulling in
+echo.anything new.
+echo.
+echo.Only the first argument is checked, all others are ignored.
+echo.
+echo.**WARNING**: the cleaning options unconditionally remove any directory
+echo.that is a child of
+echo. %CD%
+echo.and matches wildcard patterns beginning with bzip2-, db-, nasm-, openssl-,
+echo.tcl-, tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential
+echo.to be very destructive if you are not aware of what it is doing. Use with
+echo.caution!
+popd
+exit /b -1
+
+
+:end
+echo Finished.
+popd