mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:03:03 +01:00
Change way to search for unzip utility:
- allow caller (user) to explicitly set full path to the unzip.exe using FB_UNZIP environment variable, - if FB_UNZIP is not set, look up in PATH, - try GIT folder, - at last use simple VBS script.
This commit is contained in:
parent
7c91fcbe5d
commit
192e06f1e1
@ -7,13 +7,31 @@
|
||||
::==========
|
||||
:: MAIN
|
||||
|
||||
@echo Extracting pre-built ICU
|
||||
unzip -o %FB_ROOT_PATH%\extern\icu\icu_windows.zip -d %FB_ROOT_PATH%\extern\icu
|
||||
unzip -o %FB_ROOT_PATH%\extern\icu\icudt.zip -d %FB_ROOT_PATH%\extern\icu
|
||||
if errorlevel 1 call :ERROR build failed - see make_icu_%FB_TARGET_PLATFORM%.log for details
|
||||
@echo Extracting pre-built ICU and tzdata
|
||||
mkdir %FB_ROOT_PATH%\extern\icu\tzdata-extract 2> nul
|
||||
|
||||
@echo Extracting tzdata
|
||||
unzip -o %FB_ROOT_PATH%\extern\icu\tzdata\le.zip -d %FB_ROOT_PATH%\extern\icu\tzdata-extract
|
||||
:: FB_UNZIP could be set by caller, else try to find unzip in PATH or at the GIT folder
|
||||
|
||||
if not defined FB_UNZIP (
|
||||
@for /f "tokens=*" %%a in ('where unzip.exe 2^> nul') do (@SET FB_UNZIP=%%a)
|
||||
)
|
||||
|
||||
if not defined FB_UNZIP (
|
||||
@for /f "tokens=*" %%a in ('where git 2^> nul') do (@SET FB_UNZIP=%%~dpa..\usr\bin\unzip.exe)
|
||||
)
|
||||
|
||||
if not exist "%FB_UNZIP%" set FB_UNZIP=
|
||||
|
||||
if not defined FB_UNZIP (
|
||||
cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\icu_windows.zip %FB_ROOT_PATH%\extern\icu
|
||||
cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\icudt.zip %FB_ROOT_PATH%\extern\icu
|
||||
cscript /nologo unzip.vbs %FB_ROOT_PATH%\extern\icu\tzdata\le.zip %FB_ROOT_PATH%\extern\icu\tzdata-extract
|
||||
) else (
|
||||
"%FB_UNZIP%" -o %FB_ROOT_PATH%\extern\icu\icu_windows.zip -d %FB_ROOT_PATH%\extern\icu
|
||||
"%FB_UNZIP%" -o %FB_ROOT_PATH%\extern\icu\icudt.zip -d %FB_ROOT_PATH%\extern\icu
|
||||
"%FB_UNZIP%" -o %FB_ROOT_PATH%\extern\icu\tzdata\le.zip -d %FB_ROOT_PATH%\extern\icu\tzdata-extract
|
||||
)
|
||||
if errorlevel 1 call :ERROR build failed - see make_icu_%FB_TARGET_PLATFORM%.log for details
|
||||
|
||||
@goto :EOF
|
||||
|
||||
|
30
builds/win32/unzip.vbs
Normal file
30
builds/win32/unzip.vbs
Normal file
@ -0,0 +1,30 @@
|
||||
src = Wscript.Arguments(0) ' source zip archive name
|
||||
dst = Wscript.Arguments(1) ' destination folder name
|
||||
|
||||
set objShell = CreateObject("Shell.Application")
|
||||
set srcFiles = objShell.NameSpace(src)
|
||||
set dstFolder = objShell.NameSpace(dst)
|
||||
|
||||
if (srcFiles is nothing) then
|
||||
set fso = CreateObject("Scripting.FileSystemObject")
|
||||
fso.GetStandardStream(2).WriteLine "Wrong source file name: " & src
|
||||
Wscript.Quit
|
||||
end if
|
||||
|
||||
|
||||
if (dstFolder is nothing) then
|
||||
set fso = CreateObject("Scripting.FileSystemObject")
|
||||
call fso.CreateFolder(dst)
|
||||
set dstFolder = objShell.NameSpace(dst)
|
||||
end if
|
||||
|
||||
' Options
|
||||
' 4
|
||||
' Do not display a progress dialog box.
|
||||
' 16
|
||||
' Respond with "Yes to All" for any dialog box that is displayed.
|
||||
|
||||
call dstFolder.CopyHere(srcFiles.items, 16+4)
|
||||
|
||||
set srcFiles = Nothing
|
||||
Set objShell = Nothing
|
Loading…
Reference in New Issue
Block a user