Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 1 | @echo off |
| 2 | setlocal |
| 3 | rem Simple script to fetch source for external libraries |
| 4 | |
| 5 | pushd "%~dp0..\.." |
| 6 | |
| 7 | if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/ |
| 8 | |
| 9 | rem Optionally clean up first. Be warned that this can be very destructive! |
| 10 | if not "%1"=="" ( |
| 11 | for %%c in (-c --clean --clean-only) do ( |
| 12 | if "%1"=="%%c" goto clean |
| 13 | ) |
| 14 | goto usage |
| 15 | ) |
| 16 | goto fetch |
| 17 | |
| 18 | :clean |
| 19 | echo.Cleaning up external libraries. |
| 20 | for /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 | ) |
| 34 | if "%1"=="--clean-only" ( |
| 35 | goto end |
| 36 | ) |
| 37 | |
| 38 | :fetch |
| 39 | rem Fetch current versions |
| 40 | |
| 41 | svn --version > nul 2>&1 |
| 42 | if 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 | |
| 50 | echo.Fetching external libraries... |
| 51 | |
| 52 | for %%e in ( |
| 53 | bzip2-1.0.6 |
Zachary Ware | b40cf1f | 2014-08-06 23:21:03 -0500 | [diff] [blame^] | 54 | openssl-1.0.1i |
Zachary Ware | e12fa65 | 2014-07-07 13:39:59 -0500 | [diff] [blame] | 55 | 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 | |
| 69 | goto end |
| 70 | |
| 71 | :usage |
| 72 | echo.invalid argument: %1 |
| 73 | echo.usage: %~n0 [[ -c ^| --clean ] ^| --clean-only ] |
| 74 | echo. |
| 75 | echo.Pull all sources necessary for compiling optional extension modules |
| 76 | echo.that rely on external libraries. Requires svn.exe to be on your PATH |
| 77 | echo.and pulls sources from %SVNROOT%. |
| 78 | echo. |
| 79 | echo.Use the -c or --clean option to clean up all external library sources |
| 80 | echo.before pulling in the current versions. |
| 81 | echo. |
| 82 | echo.Use the --clean-only option to do the same cleaning, without pulling in |
| 83 | echo.anything new. |
| 84 | echo. |
| 85 | echo.Only the first argument is checked, all others are ignored. |
| 86 | echo. |
| 87 | echo.**WARNING**: the cleaning options unconditionally remove any directory |
| 88 | echo.that is a child of |
| 89 | echo. %CD% |
| 90 | echo.and matches wildcard patterns beginning with bzip2-, db-, openssl-, tcl-, |
| 91 | echo.tcltk, tk-, tix-, sqlite-, or xz-, and as such has the potential to be |
| 92 | echo.very destructive if you are not aware of what it is doing. Use with |
| 93 | echo.caution! |
| 94 | popd |
| 95 | exit /b -1 |
| 96 | |
| 97 | |
| 98 | :end |
| 99 | echo Finished. |
| 100 | popd |