blob: 783df5c14abb9b219950157477cc98e69cae86bc [file] [log] [blame]
Zachary Waree12fa652014-07-07 13:39:59 -05001@echo off
2setlocal
3rem Simple script to fetch source for external libraries
4
5pushd "%~dp0..\.."
6
7if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
8
9rem Optionally clean up first. Be warned that this can be very destructive!
10if not "%1"=="" (
11 for %%c in (-c --clean --clean-only) do (
12 if "%1"=="%%c" goto clean
13 )
14 goto usage
15)
16goto fetch
17
18:clean
19echo.Cleaning up external libraries.
20for /D %%d in (
21 bzip2-*
22 db-*
23 openssl-*
24 tcl-*
25 tcltk*
26 tk-*
27 tix-*
28 sqlite-*
29 xz-*
30 ) do (
31 echo.Removing %%d
32 rmdir /s /q %%d
33)
34if "%1"=="--clean-only" (
35 goto end
36)
37
38:fetch
39rem Fetch current versions
40
41svn --version > nul 2>&1
42if ERRORLEVEL 9009 (
43 echo.svn.exe must be on your PATH.
44 echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
45 echo.command line tools option.
46 popd
47 exit /b 1
48)
49
50echo.Fetching external libraries...
51
52for %%e in (
53 bzip2-1.0.6
Zachary Wareb40cf1f2014-08-06 23:21:03 -050054 openssl-1.0.1i
Zachary Waree12fa652014-07-07 13:39:59 -050055 tcl-8.6.1.0
56 tk-8.6.1.0
57 tix-8.4.3.4
58 sqlite-3.8.3.1
59 xz-5.0.5
60 ) do (
61 if exist %%e (
62 echo.%%e already exists, skipping.
63 ) else (
64 echo.Fetching %%e...
65 svn export %SVNROOT%%%e
66 )
67)
68
69goto end
70
71:usage
72echo.invalid argument: %1
73echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ]
74echo.
75echo.Pull all sources necessary for compiling optional extension modules
76echo.that rely on external libraries. Requires svn.exe to be on your PATH
77echo.and pulls sources from %SVNROOT%.
78echo.
79echo.Use the -c or --clean option to clean up all external library sources
80echo.before pulling in the current versions.
81echo.
82echo.Use the --clean-only option to do the same cleaning, without pulling in
83echo.anything new.
84echo.
85echo.Only the first argument is checked, all others are ignored.
86echo.
87echo.**WARNING**: the cleaning options unconditionally remove any directory
88echo.that is a child of
89echo. %CD%
90echo.and matches wildcard patterns beginning with bzip2-, db-, openssl-, tcl-,
91echo.tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential to be
92echo.very destructive if you are not aware of what it is doing. Use with
93echo.caution!
94popd
95exit /b -1
96
97
98:end
99echo Finished.
100popd