@@ -54,7 +54,7 @@ if not defined FB2_SNAPSHOT (set FB2_SNAPSHOT=0)
5454
5555:: Are we doing a snapshot build? If so we always do less work.
5656if " %FB2_SNAPSHOT% " == " 1" (
57- (set FBBUILD_ISX_PACK=0)
57+ ( set FBBUILD_ISX_PACK = 0 )
5858)
5959
6060
@@ -69,14 +69,14 @@ if "%FB2_SNAPSHOT%"=="1" (
6969:: let's bail out now.
7070
7171@ echo o Checking for sed...
72- (cmd /c " sed.exe --version 2>&1 > nul " ) || ( call :ERROR Could not locate sed && @ goto :EOF )
72+ @ (cmd /c " sed.exe --version 2>&1 > nul " ) || ( call :ERROR Could not locate sed & goto :EOF )
7373
7474@ echo o Checking for unix2dos...
75- (cmd /c " unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos && @ goto :EOF )
75+ @ (cmd /c " unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos & goto :EOF )
7676
77- @ for /f " usebackq tokens=*" %% c in (`where /f md5sum 2^ > nul `) do set MD5_COMMAND = %% c
78- if defined MD5_COMMAND (
79- @ echo o POSIX md5sum utility found at %MD5_COMMAND%
77+ @ for /f " usebackq tokens=*" %% c in ( `where /f md5sum 2^ > nul ` ) do set MD5_COMMAND = %% c
78+ @ if defined MD5_COMMAND (
79+ echo o POSIX md5sum utility found at %MD5_COMMAND%
8080)
8181
8282@ if %FBBUILD_ZIP_PACK% EQU 1 (
@@ -101,8 +101,8 @@ if defined MD5_COMMAND (
101101 for /f " usebackq tokens=*" %%c in ( `where /f iscc 2^ > nul ` ) do set ISCC_COMMAND = %%c
102102)
103103@ if not defined ISCC_COMMAND (
104- @ echo Required Inno Setup compiler not found
105- @ exit /b 1
104+ echo Required Inno Setup compiler not found
105+ exit /b 1
106106)
107107@ echo o Inno Setup found as %ISCC_COMMAND% .
108108
@@ -114,17 +114,17 @@ if defined MD5_COMMAND (
114114 echo WiX is needed to build the MSI kits of the CRT runtimes.
115115 echo .
116116) else (
117- echo o WiX found at " %WIX% " .
117+ echo o WiX found at " %WIX% " .
118118)
119119
120120@ if not defined FB_EXTERNAL_DOCS (
121- echo .
122- echo The FB_EXTERNAL_DOCS environment var is not defined
123- echo It should point to the directory containing the relevant release notes
124- echo in adobe pdf format.
125- echo .
121+ echo .
122+ echo The FB_EXTERNAL_DOCS environment var is not defined
123+ echo It should point to the directory containing the relevant release notes
124+ echo in adobe pdf format.
125+ echo .
126126) else (
127- echo o Package will include documentation from " %FB_EXTERNAL_DOCS% " .
127+ echo o Package will include documentation from " %FB_EXTERNAL_DOCS% " .
128128)
129129
130130
@@ -192,7 +192,7 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
192192 %SED_COMMAND% %% f > %FB_GEN_DIR% \readmes\%% f
193193)
194194@ for %% d in (ba cz de es fr hu it pl pt ru si ) do (
195- if not exist %FB_GEN_DIR% \readmes\%% d ( @ mkdir %FB_GEN_DIR% \readmes\%% d )
195+ if not exist %FB_GEN_DIR% \readmes\%% d ( mkdir %FB_GEN_DIR% \readmes\%% d )
196196 for %%f in ( %%d \*.txt ) do (
197197 echo Processing version strings in %%f
198198 %SED_COMMAND% %%f > %FB_GEN_DIR% \readmes\%%f
@@ -201,6 +201,9 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
201201
202202@ endlocal
203203
204+ :: Dump env vars to file for later testing.
205+ @ set > %FB_ROOT_PATH% \builds\install\arch-specific\win32\test_installer\fb_build_vars_%PROCESSOR_ARCHITECTURE% .txt
206+
204207:: End of SET_VERSION
205208:: ----------------
206209@ goto :EOF
@@ -232,11 +235,13 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
232235 )
233236)
234237
235- @ where /Q implib.exe
236- @ if not ERRORLEVEL 1 (
237- if " %VSCMD_ARG_TGT_ARCH% " == " x86 " (
238- echo Generating fbclient_bor.lib
238+ @ if " %VSCMD_ARG_TGT_ARCH% " == " x86 " (
239+ echo Generating fbclient_bor.lib
240+ where /Q implib.exe
241+ if not ERRORLEVEL 1 (
239242 implib %FB_OUTPUT_DIR% \lib\fbclient_bor.lib %FB_OUTPUT_DIR% \fbclient.dll > nul
243+ ) else (
244+ call :ERROR implib not found & goto :EOF
240245 )
241246)
242247
@@ -289,7 +294,7 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
289294@ mkdir %FB_OUTPUT_DIR% \doc\sql.extensions 2 > nul
290295@ if ERRORLEVEL 2 ( ( call :ERROR MKDIR for doc\sql.extensions dir failed) & ( goto :EOF ) )
291296@ copy %FB_ROOT_PATH% \doc\sql.extensions\*.* %FB_OUTPUT_DIR% \doc\sql.extensions\ > nul
292- @ if ERRORLEVEL 1 ( ( call :ERROR Copying doc\sql.extensions failed ) & ( goto :EOF ) )
297+ @ if ERRORLEVEL 1 ( ( call :ERROR Copying doc\sql.extensions failed ) & ( goto :EOF ) )
293298
294299:: External docs aren't necessary for a snapshot build, so we don't throw
295300:: an error if FB_EXTERNAL_DOCS is not defined. On the other hand,
@@ -300,15 +305,17 @@ set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
300305 echo ... %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v
301306 copy /Y %FB_EXTERNAL_DOCS% \%%v %FB_OUTPUT_DIR% \doc\%%v > nul
302307 if ERRORLEVEL 1 (
303- call :ERROR Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & @ goto :EOF
308+ call :ERROR Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & goto :EOF
304309 )
305310 )
306311
307312 echo Copying optional pdf docs...
308313 for %%v in ( firebird-%FB_MAJOR_VER% -quickstartguide.pdf ) do (
309314 echo ... %%v
310315 copy /Y %FB_EXTERNAL_DOCS% \%%v %FB_OUTPUT_DIR% \doc\%%v > nul
311- if ERRORLEVEL 1 ( call :WARNING Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & @ goto :EOF )
316+ if ERRORLEVEL 1 (
317+ call :WARNING Copying %FB_EXTERNAL_DOCS% \%%v to %FB_OUTPUT_DIR% \doc\%%v FAILED. & goto :EOF
318+ )
312319 )
313320
314321 echo Finished copying pdf docs...
@@ -333,7 +340,7 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
333340
334341:: Walk through all docs and transform any that are not .txt, .pdf or .html to .txt
335342@ echo Setting .txt filetype to ascii docs.
336- for /R %FB_OUTPUT_DIR% \doc %%v in ( * ) do (
343+ @ for /R %FB_OUTPUT_DIR% \doc %% v in ( * ) do (
337344 if /I not " %% ~xv" == " .md" (
338345 if /I not " %% ~xv" == " .txt" (
339346 if /I not " %% ~xv" == " .pdf" (
@@ -390,11 +397,11 @@ for /R %FB_OUTPUT_DIR%\doc %%v in ( * ) do (
390397:: grab some missing bits'n'pieces from different parts of the source tree
391398:: =========================================================================
392399@ echo Copying ib_util etc
393- @ copy %FB_ROOT_PATH% \src\extlib\ib_util.h %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.h failed. && @ goto :EOF )
394- @ copy %FB_ROOT_PATH% \src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.pas failed. && @ goto :EOF )
400+ @ copy %FB_ROOT_PATH% \src\extlib\ib_util.h %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.h failed. & goto :EOF )
401+ @ copy %FB_ROOT_PATH% \src\misc\pascal\ib_util.pas %FB_OUTPUT_DIR% \include > nul || (call :WARNING Copying ib_util.pas failed. & goto :EOF )
395402
396403@ echo Copying other include files required for development...
397- set OUTPATH = %FB_OUTPUT_DIR% \include
404+ @ set OUTPATH = %FB_OUTPUT_DIR% \include
398405@ copy %FB_ROOT_PATH% \src\yvalve\perf.h %OUTPATH% \ > nul
399406@ copy %FB_ROOT_PATH% \src\include\gen\firebird.pas %OUTPATH% \firebird\ > nul || (@ call :ERROR Failure executing copy %FB_ROOT_PATH% \src\include\gen\firebird.pas %OUTPATH% \firebird\ )
400407@ if ERRORLEVEL 1 goto :END
@@ -424,7 +431,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
424431:: =================================================================
425432@ if not exist %FB_OUTPUT_DIR% \firebird.msg (
426433 copy %FB_GEN_DIR% \firebird.msg %FB_OUTPUT_DIR% \firebird.msg > nul
427- if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
434+ if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
428435)
429436
430437:: End of FB_MSG
@@ -437,7 +444,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
437444:: that and they all have windows EOL
438445:: ===============================================
439446@ for /R %FB_OUTPUT_DIR% %% W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.pas *.e *.def *.rc *.md *.html ) do (
440- unix2dos --quiet -- safe %% W || exit /b 1
447+ unix2dos --safe %% W > nul 2 >& 1 || exit /b 1
441448)
442449
443450:: End of SET_CRLF
@@ -627,40 +634,40 @@ popd
627634
628635@ echo .
629636@ echo Reading command-line parameters...
630- @ (@ call :SET_PARAMS %* )
631- @ if ERRORLEVEL 1 (@ call :ERROR Call ing SET_PARAMS & goto :END)
637+ @ (call :SET_PARAMS %* )
638+ @ if ERRORLEVEL 1 (call :ERROR Call ing SET_PARAMS & goto :END)
632639
633640@ echo .
634641@ echo Checking that all required components are available...
635- @ (@ call :CHECK_ENVIRONMENT ) || ( @ echo Error calling CHECK_ENVIRONMENT && @ goto :END )
642+ @ ( call :CHECK_ENVIRONMENT ) || ( echo Error calling CHECK_ENVIRONMENT & goto :END )
636643@ echo .
637644
638645@ echo Setting version number...
639- @ (@ call :SET_VERSION ) || (@ echo Error calling SET_VERSION && @ goto :END )
646+ @ ( call :SET_VERSION ) || ( echo Error calling SET_VERSION & goto :END )
640647@ echo .
641648
642649@ echo Copying additional files needed for installation, documentation etc.
643- @ ( @ call :COPY_XTRA ) || ( @ echo Error calling COPY_XTRA && @ goto :END )
650+ @ ( call :COPY_XTRA ) || ( echo Error calling COPY_XTRA & goto :END )
644651@ echo .
645652
646653:: WIX is not necessary for a snapshot build, so we don't throw
647654:: an error if WIX is not defined. On the other hand,
648655:: if it is there anyway, use it.
649656@ if defined WIX (
650657 echo Building MSI runtimes
651- ( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & @ goto :END )
658+ ( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & goto :END )
652659 echo .
653660)
654661
655662@ echo Prepare include directory
656- @ ( call :INCLUDE_DIR ) || ( @ echo Error calling INCLUDE_DIR & @ goto :END )
663+ @ ( call :INCLUDE_DIR ) || ( echo Error calling INCLUDE_DIR & goto :END )
657664@ echo .
658665
659666@ echo Writing databases conf
660- @ (call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
667+ @ ( call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
661668@ echo .
662669@ echo Copying firebird.msg
663- @ (call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
670+ @ ( call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
664671@ echo .
665672
666673@ echo Fix up line endings...
675682
676683@ if %FBBUILD_ISX_PACK% EQU 1 (
677684 echo Now let's compile the InnoSetup scripts
678- ( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
685+ ( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
679686 echo .
680687)
681688
698705
699706exit /b %ERRLEV%
700707
701-
0 commit comments