diff options
author | Karlson2k <k2k@narod.ru> | 2013-09-14 23:26:59 +0400 |
---|---|---|
committer | Karlson2k <k2k@narod.ru> | 2013-10-01 16:34:26 +0400 |
commit | e9b0e9a7b41ea28c4c9fbb42ed9771bb5630a4ba (patch) | |
tree | 9350feb2baffbdee54a98c97f06f553f304dbad4 /project/BuildDependencies | |
parent | e3fa47e1d617a4d6b3438a08cafaa6af5487bebb (diff) |
[win32] Add batch file for getting formed build packages
Diffstat (limited to 'project/BuildDependencies')
-rw-r--r-- | project/BuildDependencies/scripts/get_formed.cmd | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/project/BuildDependencies/scripts/get_formed.cmd b/project/BuildDependencies/scripts/get_formed.cmd new file mode 100644 index 0000000000..d5a07073fc --- /dev/null +++ b/project/BuildDependencies/scripts/get_formed.cmd @@ -0,0 +1,76 @@ +@ECHO OFF + +SETLOCAL + +REM Check presence of required file +dir 0_package.list >NUL 2>NUL || ( +ECHO 0_package.list not found! +ECHO Aborting... +EXIT /B 20 +) + +CALL :setStageName Starting downloads of formed packages... +SET SCRIPT_PATH=%CD% +CD %DL_PATH% || EXIT /B 10 +FOR /F "eol=; tokens=1" %%f IN (%SCRIPT_PATH%\0_package.list) DO ( +CALL :processFile %%f +IF ERRORLEVEL 1 EXIT /B %ERRORLEVEL% +) + +CALL :setStageName All formed packages ready. +EXIT /B 0 +REM End of main body + + +:processFile +CALL :setStageName Getting %1... +IF EXIST %1 ( + ECHO Using downloaded %1 +) ELSE ( + CALL :setSubStageName Downloading %1... + %WGET% "http://mirrors.xbmc.org/build-deps/win32/%1" || EXIT /B 7 + TITLE Getting %1 +) + +CALL :setSubStageName Extracting %1... +copy /b "%1" "%TMP_PATH%" || EXIT /B 5 +PUSHD "%TMP_PATH%" || EXIT /B 10 +%ZIP% x %1 || exit /B 6 + +dir /A:-D "%~n1\*.*" >NUL 2>NUL && ( +CALL :setSubStageName Pre-Cleaning %1... +REM Remove any non-dir files in extracted ".\packagename\" +FOR /F %%f IN ('dir /B /A:-D "%~n1\*.*"') DO (del "%~n1\%%f" /F /Q || EXIT /B 4) +) + +CALL :setSubStageName Copying %1 to build tree... +REM Copy only content of extracted ".\packagename\" +XCOPY "%~n1\*" "%XBMC_PATH%\" /E /I /Y /F /R /H /K || EXIT /B 5 + +dir /A:-D * >NUL 2>NUL && ( +CALL :setSubStageName Post-Cleaning %1... +REM Delete package archive and possible garbage +FOR /F %%f IN ('dir /B /A:-D') DO (del %%f /F /Q || EXIT /B 4) +) + +ECHO. +ECHO Done %1. +POPD || EXIT /B 10 + +EXIT /B 0 +REM end of :processFile + +:setStageName +ECHO. +ECHO ================================================== +ECHO %* +ECHO. +TITLE %* +EXIT /B 0 + +:setSubStageName +ECHO. +ECHO -------------------------------------------------- +ECHO %* +ECHO. +EXIT /B 0 |