8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 18:43:02 +01:00

Use @ consistently to produce cleaner output

and make debugging easier if case of problems
This commit is contained in:
Paul Reeves 2024-06-21 11:33:07 +02:00
parent 0097d28d30
commit 8de93af965

View File

@ -44,7 +44,7 @@ if not defined FB2_SNAPSHOT (set FB2_SNAPSHOT=0)
:: See what we have on the command line :: See what we have on the command line
for %%v in ( %* ) do ( @for %%v in ( %* ) do (
( if /I "%%v"=="DEBUG" (set FBBUILD_BUILDTYPE=debug) ) ( if /I "%%v"=="DEBUG" (set FBBUILD_BUILDTYPE=debug) )
( if /I "%%v"=="PDB" (set FBBUILD_SHIP_PDB=ship_pdb) ) ( if /I "%%v"=="PDB" (set FBBUILD_SHIP_PDB=ship_pdb) )
( if /I "%%v"=="ZIP" (set FBBUILD_ZIP_PACK=1) ) ( if /I "%%v"=="ZIP" (set FBBUILD_ZIP_PACK=1) )
@ -52,7 +52,7 @@ for %%v in ( %* ) do (
( if /I "%%v"=="ALL" ( (set FBBUILD_ZIP_PACK=1) & (set FBBUILD_ISX_PACK=1) ) ) ( if /I "%%v"=="ALL" ( (set FBBUILD_ZIP_PACK=1) & (set FBBUILD_ISX_PACK=1) ) )
) )
::Are we doing a snapshot build? If so we always do less work. :: Are we doing a snapshot build? If so we always do less work.
if "%FB2_SNAPSHOT%"=="1" ( if "%FB2_SNAPSHOT%"=="1" (
(set FBBUILD_ISX_PACK=0) (set FBBUILD_ISX_PACK=0)
) )
@ -72,33 +72,35 @@ if "%FB2_SNAPSHOT%"=="1" (
(cmd /c "sed.exe --version 2>&1 > nul ") || ( call :ERROR Could not locate sed && @goto :EOF ) (cmd /c "sed.exe --version 2>&1 > nul ") || ( call :ERROR Could not locate sed && @goto :EOF )
@echo o Checking for unix2dos... @echo o Checking for unix2dos...
(cmd /c "unix2dos.exe --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos && @goto :EOF ) (cmd /c "unix2dos.exe --quiet --version 2>&1 > nul" ) || ( call :ERROR Could not locate unix2dos && @goto :EOF )
@for /f "usebackq tokens=*" %%c in (`where /f md5sum 2^>nul`) do set MD5_COMMAND=%%c @for /f "usebackq tokens=*" %%c in (`where /f md5sum 2^>nul`) do set MD5_COMMAND=%%c
if defined MD5_COMMAND ( if defined MD5_COMMAND (
@echo o POSIX md5sum utility found at %MD5_COMMAND% @echo o POSIX md5sum utility found at %MD5_COMMAND%
) )
if %FBBUILD_ZIP_PACK% EQU 1 ( @if %FBBUILD_ZIP_PACK% EQU 1 (
if not defined SEVENZIP ( if not defined SEVENZIP (
if exist "%ProgramW6432%\7-Zip\7z.exe" set SEVENZIP=%ProgramW6432%\7-Zip if exist "%ProgramW6432%\7-Zip\7z.exe" set SEVENZIP=%ProgramW6432%\7-Zip
) )
if not defined SEVENZIP ( if not defined SEVENZIP (
call :ERROR SEVENZIP environment variable is not defined. call :ERROR SEVENZIP environment variable is not defined.
@goto :EOF goto :EOF
) else (@echo o Compression utility found.) ) else (
echo o Compression utility found.
)
) )
if %FBBUILD_ISX_PACK% NEQ 1 goto :SKIP_INNO @if %FBBUILD_ISX_PACK% NEQ 1 goto :SKIP_INNO
if defined INNO6_SETUP_PATH ( @if defined INNO6_SETUP_PATH (
set ISCC_COMMAND="%INNO6_SETUP_PATH%\iscc.exe" set ISCC_COMMAND="%INNO6_SETUP_PATH%\iscc.exe"
) )
:: If the environment variable is not set let's search in PATH :: If the environment variable is not set let's search in PATH
if not defined ISCC_COMMAND ( @if not defined ISCC_COMMAND (
@for /f "usebackq tokens=*" %%c in (`where /f iscc 2^>nul`) do set ISCC_COMMAND=%%c for /f "usebackq tokens=*" %%c in ( `where /f iscc 2^>nul` ) do set ISCC_COMMAND=%%c
) )
if not defined ISCC_COMMAND ( @if not defined ISCC_COMMAND (
@echo Required Inno Setup compiler not found @echo Required Inno Setup compiler not found
@exit /b 1 @exit /b 1
) )
@ -106,23 +108,23 @@ if not defined ISCC_COMMAND (
:SKIP_INNO :SKIP_INNO
if not defined WIX ( @if not defined WIX (
@echo. echo.
@echo The WIX environment var not defined. echo The WIX environment var not defined.
@echo WiX is needed to build the MSI kits of the CRT runtimes. echo WiX is needed to build the MSI kits of the CRT runtimes.
@echo. echo.
) else ( ) else (
@echo o WiX found at "%WIX%". echo o WiX found at "%WIX%".
) )
if not defined FB_EXTERNAL_DOCS ( @if not defined FB_EXTERNAL_DOCS (
@echo. echo.
@echo The FB_EXTERNAL_DOCS environment var is not defined echo The FB_EXTERNAL_DOCS environment var is not defined
@echo It should point to the directory containing the relevant release notes echo It should point to the directory containing the relevant release notes
@echo in adobe pdf format. echo in adobe pdf format.
@echo. echo.
) else ( ) else (
@echo o Package will include documentation from "%FB_EXTERNAL_DOCS%". echo o Package will include documentation from "%FB_EXTERNAL_DOCS%".
) )
@ -135,19 +137,19 @@ if not defined FB_EXTERNAL_DOCS (
::========== ::==========
:: Cut off everything that is not #define to let Inno Setup use it :: Cut off everything that is not #define to let Inno Setup use it
findstr /B /L "#define" "%FB_ROOT_PATH%\src\jrd\build_no.h" >"%FB_ROOT_PATH%\gen\jrd\build_no.h" @findstr /B /L "#define" "%FB_ROOT_PATH%\src\jrd\build_no.h" >"%FB_ROOT_PATH%\gen\jrd\build_no.h"
:: Read version parameters from build_no.h :: Read version parameters from build_no.h
for /F "tokens=2*" %%a in (%FB_ROOT_PATH%\gen\jrd\build_no.h) do ( @for /F "tokens=2*" %%a in ( %FB_ROOT_PATH%\gen\jrd\build_no.h ) do (
@echo Setting %%a to %%~b echo Setting %%a to %%~b
SET %%a=%%~b SET %%a=%%~b
) )
:: Set our package number at 0 and increment every :: Set our package number at 0 and increment every
:: time we rebuild in a single session :: time we rebuild in a single session
if not defined FBBUILD_PACKAGE_NUMBER ( @if not defined FBBUILD_PACKAGE_NUMBER (
set FBBUILD_PACKAGE_NUMBER=0 set FBBUILD_PACKAGE_NUMBER=0
) else ( ) else (
set /A FBBUILD_PACKAGE_NUMBER+=1 set /A FBBUILD_PACKAGE_NUMBER+=1
) )
@echo Setting FBBUILD_PACKAGE_NUMBER to %FBBUILD_PACKAGE_NUMBER% @echo Setting FBBUILD_PACKAGE_NUMBER to %FBBUILD_PACKAGE_NUMBER%
@ -162,38 +164,38 @@ set /A FBBUILD_PACKAGE_NUMBER+=1
:: Set up our final destination :: Set up our final destination
set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images set FBBUILD_INSTALL_IMAGES=%FB_ROOT_PATH%\builds\install_images
if not exist "%FBBUILD_INSTALL_IMAGES%" (mkdir "%FBBUILD_INSTALL_IMAGES%") @if not exist "%FBBUILD_INSTALL_IMAGES%" ( mkdir "%FBBUILD_INSTALL_IMAGES%" )
:: Determine Product Status :: Determine Product Status
if %FB_BUILD_TYPE%==V ( @if %FB_BUILD_TYPE%==V (
set FBBUILD_PROD_STATUS=PROD set FBBUILD_PROD_STATUS=PROD
) else ( ) else (
set FBBUILD_PROD_STATUS=DEV set FBBUILD_PROD_STATUS=DEV
) )
if "%FB_TARGET_PLATFORM%"=="x64" ( @if "%FB_TARGET_PLATFORM%"=="x64" (
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x64 set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x64
) else ( ) else (
set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x86 set FBBUILD_FILE_ID=%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows-x86
) )
@setlocal @setlocal
@echo. @echo.
@if not exist %FB_GEN_DIR%\readmes (@mkdir %FB_GEN_DIR%\readmes) @if not exist %FB_GEN_DIR%\readmes ( mkdir %FB_GEN_DIR%\readmes )
set SED_COMMAND=sed -e s/\$MAJOR/%FB_MAJOR_VER%/g ^ @set SED_COMMAND=sed -e s/\$MAJOR/%FB_MAJOR_VER%/g ^
-e s/\$MINOR/%FB_MINOR_VER%/g ^ -e s/\$MINOR/%FB_MINOR_VER%/g ^
-e s/\$RELEASE/%FB_REV_NO%/g -e s/\$RELEASE/%FB_REV_NO%/g
@echo Processing version strings in Readme_%FBBUILD_PROD_STATUS%.txt @echo Processing version strings in Readme_%FBBUILD_PROD_STATUS%.txt
@%SED_COMMAND% Readme_%FBBUILD_PROD_STATUS%.txt > %FB_GEN_DIR%\readmes\Readme.txt @%SED_COMMAND% Readme_%FBBUILD_PROD_STATUS%.txt > %FB_GEN_DIR%\readmes\Readme.txt
@for %%f in (installation_readme.txt) do ( @for %%f in ( installation_readme.txt installation_scripted.txt ) do (
@echo Processing version strings in %%f echo Processing version strings in %%f
@%SED_COMMAND% %%f > %FB_GEN_DIR%\readmes\%%f %SED_COMMAND% %%f > %FB_GEN_DIR%\readmes\%%f
) )
@for %%d in (ba cz de es fr hu it pl pt ru si ) do ( @for %%d in (ba cz de es fr hu it pl pt ru si ) do (
@if not exist %FB_GEN_DIR%\readmes\%%d (@mkdir %FB_GEN_DIR%\readmes\%%d) if not exist %FB_GEN_DIR%\readmes\%%d ( @mkdir %FB_GEN_DIR%\readmes\%%d )
@for %%f in ( %%d\*.txt ) do ( for %%f in ( %%d\*.txt ) do (
@echo Processing version strings in %%f echo Processing version strings in %%f
@%SED_COMMAND% %%f > %FB_GEN_DIR%\readmes\%%f %SED_COMMAND% %%f > %FB_GEN_DIR%\readmes\%%f
) )
) )
@ -212,7 +214,7 @@ set SED_COMMAND=sed -e s/\$MAJOR/%FB_MAJOR_VER%/g ^
@echo Copying MSVC runtime libraries... @echo Copying MSVC runtime libraries...
@if not exist %FB_OUTPUT_DIR%\system32 ( @if not exist %FB_OUTPUT_DIR%\system32 (
@mkdir %FB_OUTPUT_DIR%\system32 mkdir %FB_OUTPUT_DIR%\system32
) )
:: Note the confusion of RT library numbers here! These notes, as of time of :: Note the confusion of RT library numbers here! These notes, as of time of
:: writing 2021-12-21, are accurate for current versions of Visual Studio :: writing 2021-12-21, are accurate for current versions of Visual Studio
@ -222,35 +224,35 @@ set SED_COMMAND=sed -e s/\$MAJOR/%FB_MAJOR_VER%/g ^
:: these version numbers. %MSVC_RUNTIME_FILE_VERSION% should represent 140. :: these version numbers. %MSVC_RUNTIME_FILE_VERSION% should represent 140.
:: %MSVC_RUNTIME_LIBRARY_VERSION% is based on the Visual Studio version used. :: %MSVC_RUNTIME_LIBRARY_VERSION% is based on the Visual Studio version used.
:: These variables are set in setenvvar.bat. :: These variables are set in setenvvar.bat.
for %%f in ( msvcp%MSVC_RUNTIME_FILE_VERSION%.dll vcruntime%MSVC_RUNTIME_FILE_VERSION%.dll ) do ( @for %%f in ( msvcp%MSVC_RUNTIME_FILE_VERSION%.dll vcruntime%MSVC_RUNTIME_FILE_VERSION%.dll ) do (
echo Copying "%VCToolsRedistDir%\%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_LIBRARY_VERSION%.CRT\%%f" echo Copying "%VCToolsRedistDir%\%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_LIBRARY_VERSION%.CRT\%%f"
copy "%VCToolsRedistDir%\%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_LIBRARY_VERSION%.CRT\%%f" %FB_OUTPUT_DIR%\ >nul copy "%VCToolsRedistDir%\%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_LIBRARY_VERSION%.CRT\%%f" %FB_OUTPUT_DIR%\ >nul
if ERRORLEVEL 1 ( if ERRORLEVEL 1 (
call :ERROR Copying "%VCToolsRedistDir%\%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_LIBRARY_VERSION%.CRT\%%f" failed with error %ERRLEV% ) & (goto :EOF) call :ERROR Copying "%VCToolsRedistDir%\%VSCMD_ARG_TGT_ARCH%\Microsoft.VC%MSVC_RUNTIME_LIBRARY_VERSION%.CRT\%%f" failed with error %ERRLEV% & goto :EOF
) )
) )
@where /Q implib.exe @where /Q implib.exe
@if not ERRORLEVEL 1 ( @if not ERRORLEVEL 1 (
if "%VSCMD_ARG_TGT_ARCH%"=="x86" ( if "%VSCMD_ARG_TGT_ARCH%"=="x86" (
@echo Generating fbclient_bor.lib echo Generating fbclient_bor.lib
@implib %FB_OUTPUT_DIR%\lib\fbclient_bor.lib %FB_OUTPUT_DIR%\fbclient.dll > nul implib %FB_OUTPUT_DIR%\lib\fbclient_bor.lib %FB_OUTPUT_DIR%\fbclient.dll > nul
) )
) )
@if "%FBBUILD_SHIP_PDB%"=="ship_pdb" ( @if "%FBBUILD_SHIP_PDB%"=="ship_pdb" (
@echo Copying pdb files... echo Copying pdb files...
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\fbserver\firebird.pdb %FB_OUTPUT_DIR%\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\fbserver\firebird.pdb %FB_OUTPUT_DIR%\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\burp\burp.pdb %FB_OUTPUT_DIR%\gbak.pdb > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\burp\burp.pdb %FB_OUTPUT_DIR%\gbak.pdb > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\gfix\gfix.pdb %FB_OUTPUT_DIR%\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\gfix\gfix.pdb %FB_OUTPUT_DIR%\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\isql\isql.pdb %FB_OUTPUT_DIR%\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\isql\isql.pdb %FB_OUTPUT_DIR%\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\yvalve\fbclient.pdb %FB_OUTPUT_DIR%\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\yvalve\fbclient.pdb %FB_OUTPUT_DIR%\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\engine\engine*.pdb %FB_OUTPUT_DIR%\plugins\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\engine\engine*.pdb %FB_OUTPUT_DIR%\plugins\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\fbtrace\fbtrace.pdb %FB_OUTPUT_DIR%\plugins\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\fbtrace\fbtrace.pdb %FB_OUTPUT_DIR%\plugins\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\legacy_auth\legacy_auth.pdb %FB_OUTPUT_DIR%\plugins\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\legacy_auth\legacy_auth.pdb %FB_OUTPUT_DIR%\plugins\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\legacy_usermanager\legacy_usermanager.pdb %FB_OUTPUT_DIR%\plugins\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\legacy_usermanager\legacy_usermanager.pdb %FB_OUTPUT_DIR%\plugins\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\srp\srp.pdb %FB_OUTPUT_DIR%\plugins\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\srp\srp.pdb %FB_OUTPUT_DIR%\plugins\ > nul
@copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\udr_engine\udr_engine.pdb %FB_OUTPUT_DIR%\plugins\ > nul copy %FB_TEMP_DIR%\%FBBUILD_BUILDTYPE%\udr_engine\udr_engine.pdb %FB_OUTPUT_DIR%\plugins\ > nul
) )
@echo Started copying docs... @echo Started copying docs...
@ -264,17 +266,17 @@ if "%VSCMD_ARG_TGT_ARCH%"=="x86" (
) )
:: Various upgrade scripts and docs @echo Copy various upgrade scripts and docs
for %%d in ( v3.0 v4.0 ) do ( @for %%d in ( v3.0 v4.0 ) do (
mkdir %FB_OUTPUT_DIR%\misc\upgrade\%%d 2>nul mkdir %FB_OUTPUT_DIR%\misc\upgrade\%%d 2>nul
@copy %FB_ROOT_PATH%\src\misc\upgrade\%%d\*.* %FB_OUTPUT_DIR%\misc\upgrade\%%d > nul copy %FB_ROOT_PATH%\src\misc\upgrade\%%d\*.* %FB_OUTPUT_DIR%\misc\upgrade\%%d > nul
@if ERRORLEVEL 1 ( if ERRORLEVEL 1 (
call :ERROR copy %FB_ROOT_PATH%\src\misc\upgrade\%%d\*.* %FB_OUTPUT_DIR%\misc\upgrade\%%d failed. call :ERROR copy %FB_ROOT_PATH%\src\misc\upgrade\%%d\*.* %FB_OUTPUT_DIR%\misc\upgrade\%%d failed.
goto :EOF goto :EOF
) )
) )
:: INTL script @echo Copy INTL script
@copy %FB_ROOT_PATH%\src\misc\intl.sql %FB_OUTPUT_DIR%\misc\ > nul @copy %FB_ROOT_PATH%\src\misc\intl.sql %FB_OUTPUT_DIR%\misc\ > nul
@if ERRORLEVEL 1 ( @if ERRORLEVEL 1 (
call :ERROR copy %FB_ROOT_PATH%\src\misc\intl.sql %FB_OUTPUT_DIR%\misc failed. call :ERROR copy %FB_ROOT_PATH%\src\misc\intl.sql %FB_OUTPUT_DIR%\misc failed.
@ -284,15 +286,6 @@ for %%d in ( v3.0 v4.0 ) do (
@echo Copying other documentation... @echo Copying other documentation...
@copy %FB_GEN_DIR%\readmes\installation_readme.txt %FB_OUTPUT_DIR%\doc\installation_readme.txt > nul @copy %FB_GEN_DIR%\readmes\installation_readme.txt %FB_OUTPUT_DIR%\doc\installation_readme.txt > nul
:: FIX ME - we now have some .md files and ChangeLog is no longer a monster.
:: Maybe we can just do nothing here.
:: If we are not doing a final release then include stuff that is
:: likely to be of use to testers, especially as our release notes
:: may be incomplete or non-existent
::@if /I "%FBBUILD_PROD_STATUS%"=="DEV" (
:: @copy %FB_ROOT_PATH%\ChangeLog %FB_OUTPUT_DIR%\doc\ChangeLog.txt > nul
::)
@mkdir %FB_OUTPUT_DIR%\doc\sql.extensions 2>nul @mkdir %FB_OUTPUT_DIR%\doc\sql.extensions 2>nul
@if ERRORLEVEL 2 ( ( call :ERROR MKDIR for doc\sql.extensions dir failed) & ( goto :EOF ) ) @if ERRORLEVEL 2 ( ( call :ERROR MKDIR for doc\sql.extensions dir failed) & ( goto :EOF ) )
@copy %FB_ROOT_PATH%\doc\sql.extensions\*.* %FB_OUTPUT_DIR%\doc\sql.extensions\ > nul @copy %FB_ROOT_PATH%\doc\sql.extensions\*.* %FB_OUTPUT_DIR%\doc\sql.extensions\ > nul
@ -302,28 +295,24 @@ for %%d in ( v3.0 v4.0 ) do (
:: an error if FB_EXTERNAL_DOCS is not defined. On the other hand, :: an error if FB_EXTERNAL_DOCS is not defined. On the other hand,
:: if the docs are available then we must include them. :: if the docs are available then we must include them.
@if defined FB_EXTERNAL_DOCS ( @if defined FB_EXTERNAL_DOCS (
echo Copying pdf docs... echo Copying essential pdf docs...
for %%v in ( Firebird-%FB_MAJOR_VER%.%FB_MINOR_VER%.%FB_REV_NO%%FBBUILD_FILENAME_SUFFIX%-ReleaseNotes.pdf ) do ( for %%v in ( Firebird-%FB_MAJOR_VER%.%FB_MINOR_VER%.%FB_REV_NO%%FBBUILD_FILENAME_SUFFIX%-ReleaseNotes.pdf ) do (
echo ... %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v echo ... %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v
copy /Y %FB_EXTERNAL_DOCS%\%%v %FB_OUTPUT_DIR%\doc\%%v > nul copy /Y %FB_EXTERNAL_DOCS%\%%v %FB_OUTPUT_DIR%\doc\%%v > nul
if ERRORLEVEL 1 ( call :ERROR Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & (@goto :EOF) )
)
for %%v in ( Firebird-%FB_MAJOR_VER%.%FB_MINOR_VER%-QuickStart.pdf ) do (
echo ... %%v
copy /Y %FB_EXTERNAL_DOCS%\%%v %FB_OUTPUT_DIR%\doc\%%v > nul
if ERRORLEVEL 1 ( if ERRORLEVEL 1 (
REM - As of RC1 there is no quick start guide so we do not want call :ERROR Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & @goto :EOF
REM the packaging to fail for something that doesn't exist
if "%FBBUILD_FILENAME_SUFFIX%" == "-RC1" (
echo Copying %FB_EXTERNAL_DOCS%\%%v failed.
) else (
call :WARNING Copying %FB_EXTERNAL_DOCS%\%%v failed.
)
) )
) )
echo Finished copying pdf docs...
echo. echo Copying optional pdf docs...
for %%v in ( firebird-%FB_MAJOR_VER%-quickstartguide.pdf ) do (
echo ... %%v
copy /Y %FB_EXTERNAL_DOCS%\%%v %FB_OUTPUT_DIR%\doc\%%v > nul
if ERRORLEVEL 1 ( call :WARNING Copying %FB_EXTERNAL_DOCS%\%%v to %FB_OUTPUT_DIR%\doc\%%v FAILED. & @goto :EOF )
)
echo Finished copying pdf docs...
echo.
) )
@echo Cleaning irrelevant files... @echo Cleaning irrelevant files...
@ -340,7 +329,7 @@ for %%v in (IPLicense.txt IDPLicense.txt ) do (
) )
:: And readme :: And readme
@copy %FB_GEN_DIR%\readmes\Readme.txt %FB_OUTPUT_DIR%\ > nul @copy %FB_GEN_DIR%\readmes\Readme.txt %FB_OUTPUT_DIR%\ > nul
:: Walk through all docs and transform any that are not .txt, .pdf or .html to .txt :: Walk through all docs and transform any that are not .txt, .pdf or .html to .txt
@echo Setting .txt filetype to ascii docs. @echo Setting .txt filetype to ascii docs.
@ -358,8 +347,8 @@ for /R %FB_OUTPUT_DIR%\doc %%v in ( * ) do (
) )
) )
if %FB2_SNAPSHOT% EQU 1 ( @if %FB2_SNAPSHOT% EQU 1 (
@copy %FB_ROOT_PATH%\builds\install\arch-specific\win32\readme_snapshot.txt %FB_OUTPUT_DIR%\readme_snapshot.txt > nul copy %FB_ROOT_PATH%\builds\install\arch-specific\win32\readme_snapshot.txt %FB_OUTPUT_DIR%\readme_snapshot.txt > nul
) )
@echo Completed copying docs. @echo Completed copying docs.
@ -378,14 +367,14 @@ if %FB2_SNAPSHOT% EQU 1 (
@if %MSVC_VERSION% EQU 15 ( @if %MSVC_VERSION% EQU 15 (
if not exist %FB_OUTPUT_DIR%\system32\vccrt%MSVC_RUNTIME_LIBRARY_VERSION%_%FB_TARGET_PLATFORM%.msi ( if not exist %FB_OUTPUT_DIR%\system32\vccrt%MSVC_RUNTIME_LIBRARY_VERSION%_%FB_TARGET_PLATFORM%.msi (
"%WIX%\bin\candle.exe" -v -sw1091 %FB_ROOT_PATH%\builds\win32\msvc%MSVC_VERSION%\VCCRT_%FB_TARGET_PLATFORM%.wxs -out %FB_GEN_DIR%\vccrt_%FB_TARGET_PLATFORM%.wixobj "%WIX%\bin\candle.exe" -v -sw1091 %FB_ROOT_PATH%\builds\win32\msvc%MSVC_VERSION%\VCCRT_%FB_TARGET_PLATFORM%.wxs -out %FB_GEN_DIR%\vccrt_%FB_TARGET_PLATFORM%.wixobj
@if ERRORLEVEL 1 ( if ERRORLEVEL 1 (
( call :ERROR Could not generate wixobj for MSVC Runtime MSI ) & (goto :EOF) ( call :ERROR Could not generate wixobj for MSVC Runtime MSI ) & ( goto :EOF )
) else ( ) else (
"%WIX%\bin\light.exe" -sw1076 %FB_GEN_DIR%\vccrt_%FB_TARGET_PLATFORM%.wixobj -out %FB_OUTPUT_DIR%\system32\vccrt%MSVC_RUNTIME_LIBRARY_VERSION%_%FB_TARGET_PLATFORM%.msi "%WIX%\bin\light.exe" -sw1076 %FB_GEN_DIR%\vccrt_%FB_TARGET_PLATFORM%.wixobj -out %FB_OUTPUT_DIR%\system32\vccrt%MSVC_RUNTIME_LIBRARY_VERSION%_%FB_TARGET_PLATFORM%.msi
@if ERRORLEVEL 1 ( ( call :ERROR Could not generate MSVCC Runtime MSI %MSVC_RUNTIME_LIBRARY_VERSION% ) & ( goto :EOF ) ) if ERRORLEVEL 1 ( ( call :ERROR Could not generate MSVCC Runtime MSI %MSVC_RUNTIME_LIBRARY_VERSION% ) & ( goto :EOF ) )
) )
) else ( ) else (
@echo Using an existing build of %FB_OUTPUT_DIR%\system32\vccrt%MSVC_RUNTIME_LIBRARY_VERSION%_%FB_TARGET_PLATFORM%.msi echo Using an existing build of %FB_OUTPUT_DIR%\system32\vccrt%MSVC_RUNTIME_LIBRARY_VERSION%_%FB_TARGET_PLATFORM%.msi
) )
) )
@ -397,7 +386,7 @@ if %FB2_SNAPSHOT% EQU 1 (
:INCLUDE_DIR :INCLUDE_DIR
::========== ::==========
:: Prepare other files needed for deployment to /include dir :: Prepare other files needed for deployment to /include dir
setlocal @setlocal
:: grab some missing bits'n'pieces from different parts of the source tree :: grab some missing bits'n'pieces from different parts of the source tree
::========================================================================= ::=========================================================================
@echo Copying ib_util etc @echo Copying ib_util etc
@ -410,7 +399,7 @@ set OUTPATH=%FB_OUTPUT_DIR%\include
@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\ ) @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\ )
@if ERRORLEVEL 1 goto :END @if ERRORLEVEL 1 goto :END
endlocal @endlocal
::End of INCLUDE_DIR ::End of INCLUDE_DIR
::------------------ ::------------------
@ -421,7 +410,7 @@ endlocal
:: Generate sample databases file :: Generate sample databases file
::=============================== ::===============================
@echo Creating sample databases.conf @echo Creating sample databases.conf
copy %FB_ROOT_PATH%\builds\install\misc\databases.conf %FB_OUTPUT_DIR%\databases.conf > nul @copy %FB_ROOT_PATH%\builds\install\misc\databases.conf %FB_OUTPUT_DIR%\databases.conf > nul
::End of DB_CONF ::End of DB_CONF
::----------------- ::-----------------
@ -434,8 +423,8 @@ copy %FB_ROOT_PATH%\builds\install\misc\databases.conf %FB_OUTPUT_DIR%\databases
:: in builds\win32 by build_msg.bat. Copying from there to output dir :: in builds\win32 by build_msg.bat. Copying from there to output dir
::================================================================= ::=================================================================
@if not exist %FB_OUTPUT_DIR%\firebird.msg ( @if not exist %FB_OUTPUT_DIR%\firebird.msg (
(copy %FB_GEN_DIR%\firebird.msg %FB_OUTPUT_DIR%\firebird.msg > nul) copy %FB_GEN_DIR%\firebird.msg %FB_OUTPUT_DIR%\firebird.msg > nul
(if ERRORLEVEL 1 ( ( call :ERROR Could not copy firebird.msg ) & ( goto :EOF ) ) ) if ERRORLEVEL 1 ( call :ERROR Could not copy firebird.msg & goto :EOF )
) )
::End of FB_MSG ::End of FB_MSG
@ -447,8 +436,8 @@ copy %FB_ROOT_PATH%\builds\install\misc\databases.conf %FB_OUTPUT_DIR%\databases
:: Get a list of all files in the tree make sure :: Get a list of all files in the tree make sure
:: that and they all have windows EOL :: that and they all have windows EOL
::=============================================== ::===============================================
for /R %FB_OUTPUT_DIR% %%W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.pas *.e *.def *.rc *.md *.html ) do ( @for /R %FB_OUTPUT_DIR% %%W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.pas *.e *.def *.rc *.md *.html ) do (
unix2dos --safe %%W || exit /b 1 unix2dos --quiet --safe %%W || exit /b 1
) )
::End of SET_CRLF ::End of SET_CRLF
@ -459,11 +448,11 @@ for /R %FB_OUTPUT_DIR% %%W in ( *.txt *.conf *.sql *.c *.cpp *.hpp *.h *.bat *.p
:ZIP_PACK :ZIP_PACK
::======= ::=======
:: Forcefully disable delayed expansion because of exclamation marks in 7z switches :: Forcefully disable delayed expansion because of exclamation marks in 7z switches
setlocal DisableDelayedExpansion @setlocal DisableDelayedExpansion
set SKIP_FILES=-x!*.log -x!*.exp -x!*_test.exe -x!installation_readme.txt @set SKIP_FILES=-x!*.log -x!*.exp -x!*_test.exe -x!installation_readme.txt
if "%FBBUILD_SHIP_PDB%" == "ship_pdb" ( @if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%-withDebugSymbols.zip set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%-withDebugSymbols.zip
) else ( ) else (
set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip set FBBUILD_ZIPFILE=%FBBUILD_INSTALL_IMAGES%\Firebird-%FBBUILD_FILE_ID%.zip
@ -471,17 +460,15 @@ if "%FBBUILD_SHIP_PDB%" == "ship_pdb" (
) )
:: No need to ship this file with the msi runtime :: No need to ship this file with the msi runtime
set SKIP_FILES=%SKIP_FILES% -x!*.wixpdb @set SKIP_FILES=%SKIP_FILES% -x!*.wixpdb
if "%FB2_EXAMPLES%" == "0" set SKIP_FILES=%SKIP_FILES% -xr-!examples @if "%FB2_EXAMPLES%" == "0" set SKIP_FILES=%SKIP_FILES% -xr-!examples
if exist %FBBUILD_ZIPFILE% ( @if exist %FBBUILD_ZIPFILE% del %FBBUILD_ZIPFILE%
@del %FBBUILD_ZIPFILE%
)
"%SEVENZIP%\7z.exe" a -r -tzip -mx9 %SKIP_FILES% %FBBUILD_ZIPFILE% %FB_OUTPUT_DIR%\* @"%SEVENZIP%\7z.exe" a -r -tzip -mx9 %SKIP_FILES% %FBBUILD_ZIPFILE% %FB_OUTPUT_DIR%\*
endlocal @endlocal
::End of ZIP_PACK ::End of ZIP_PACK
::---------------- ::----------------
@ -497,7 +484,7 @@ endlocal
:: ::
::================================================= ::=================================================
@echo. @echo.
call %ISCC_COMMAND% %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall.iss @call %ISCC_COMMAND% %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdInstall.iss
@echo. @echo.
::End of ISX_PACK ::End of ISX_PACK
@ -509,25 +496,25 @@ call %ISCC_COMMAND% %FB_ROOT_PATH%\builds\install\arch-specific\win32\FirebirdIn
::========= ::=========
:: Generate the md5sum checksum file :: Generate the md5sum checksum file
::================================== ::==================================
if not defined MD5_COMMAND ( @if not defined MD5_COMMAND (
call :WARNING md5sum utility not found. Cannot generate md5 sums. call :WARNING md5sum utility not found. Cannot generate md5 sums.
@goto :EOF goto :EOF
) )
set FBBUILD_MD5SUMS_FILENAME=Firebird-%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows.md5sum @set FBBUILD_MD5SUMS_FILENAME=Firebird-%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%%FBBUILD_FILENAME_SUFFIX%-windows.md5sum
@echo Generating md5sums for %FBBUILD_MD5SUMS_FILENAME% @echo Generating md5sums for %FBBUILD_MD5SUMS_FILENAME%
:: write sums into temporary file to avoid including it into the process :: write sums into temporary file to avoid including it into the process
pushd %FBBUILD_INSTALL_IMAGES% @pushd %FBBUILD_INSTALL_IMAGES%
call %MD5_COMMAND% Firebird-%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%*.* > md5sum.tmp @call %MD5_COMMAND% Firebird-%PRODUCT_VER_STRING%-%FBBUILD_PACKAGE_NUMBER%*.* > md5sum.tmp
:: then rename it to the proper name :: then rename it to the proper name
if not ERRORLEVEL 1 ( @if not ERRORLEVEL 1 (
del %FBBUILD_MD5SUMS_FILENAME% >nul 2>nul del %FBBUILD_MD5SUMS_FILENAME% >nul 2>nul
ren md5sum.tmp %FBBUILD_MD5SUMS_FILENAME% ren md5sum.tmp %FBBUILD_MD5SUMS_FILENAME%
) else ( ) else (
(@echo Error calling %0 & popd & @goto :END) echo Error calling %0 & popd & @goto :END
) )
popd @popd
::End of DO_MD5SUMS ::End of DO_MD5SUMS
::----------------- ::-----------------
@ -590,7 +577,7 @@ popd
:ERROR :ERROR
::==== ::====
set ERRLEV=%ERRORLEVEL% @set ERRLEV=%ERRORLEVEL%
@echo. @echo.
@echo Error code %ERRLEV% in %SCRIPT_SHORT_NAME% @echo Error code %ERRLEV% in %SCRIPT_SHORT_NAME%
@echo %* @echo %*
@ -602,19 +589,19 @@ set ERRLEV=%ERRORLEVEL%
:WARNING :WARNING
::====== ::======
set ERRLEV=%ERRORLEVEL% @set ERRLEV=%ERRORLEVEL%
@echo. @echo.
@echo **** WARNING - Execution of a non-critical component failed with error level %ERRLEV%. **** @echo **** WARNING - Execution of a non-critical component failed with error level %ERRLEV%. ****
@echo %* @echo %*
@echo. @echo.
if "%FBBUILD_PROD_STATUS%"=="PROD" ( @if "%FBBUILD_PROD_STATUS%" == "PROD" (
@echo. echo.
@echo Production status is Final or Release Candidate echo Production status is Final or Release Candidate
@echo Error %ERRLEV% must be fixed before continuing echo Error %ERRLEV% must be fixed before continuing
@echo. echo.
) else ( ) else (
set ERRLEV= set ERRLEV=
@ver > nul ver > nul
) )
::End of WARNING ::End of WARNING
::-------------- ::--------------
@ -624,16 +611,16 @@ set ERRLEV=
:MAIN :MAIN
::==== ::====
::Check if on-line help is required ::Check if on-line help is required
for %%v in ( %1 %2 %3 %4 %5 %6 %7 %8 %9 ) do ( @for %%v in ( %1 %2 %3 %4 %5 %6 %7 %8 %9 ) do (
( @if /I "%%v"=="-h" (goto :HELP & goto :EOF) ) if /I "%%v"=="-h" ( goto :HELP & goto :EOF )
( @if /I "%%v"=="/h" (goto :HELP & goto :EOF) ) if /I "%%v"=="/h" ( goto :HELP & goto :EOF )
( @if /I "%%v"=="HELP" (goto :HELP & goto :EOF) ) if /I "%%v"=="HELP" ( goto :HELP & goto :EOF )
) )
pushd ..\..\..\win32 pushd ..\..\..\win32
::This must be called from the directory it resides in. ::This must be called from the directory it resides in.
@call setenvvar.bat %* @call setenvvar.bat %*
@if ERRORLEVEL 1 (popd & (call :ERROR Failure after calling setenvvar.bat ) & goto :END ) @if ERRORLEVEL 1 ( popd & ( call :ERROR Failure after calling setenvvar.bat ) & goto :END )
popd popd
@if not defined FB2_ISS_DEBUG (set FB2_ISS_DEBUG=0) @if not defined FB2_ISS_DEBUG (set FB2_ISS_DEBUG=0)
@ -645,54 +632,54 @@ popd
@echo. @echo.
@echo Checking that all required components are available... @echo Checking that all required components are available...
@(@call :CHECK_ENVIRONMENT ) || (@echo Error calling CHECK_ENVIRONMENT && @goto :END) @(@call :CHECK_ENVIRONMENT ) || ( @echo Error calling CHECK_ENVIRONMENT && @goto :END )
@echo. @echo.
@echo Setting version number... @echo Setting version number...
@(@call :SET_VERSION ) || (@echo Error calling SET_VERSION && @goto :END) @(@call :SET_VERSION ) || (@echo Error calling SET_VERSION && @goto :END )
@echo. @echo.
@echo Copying additional files needed for installation, documentation etc. @echo Copying additional files needed for installation, documentation etc.
@(@call :COPY_XTRA ) || (@echo Error calling COPY_XTRA && @goto :END ) @( @call :COPY_XTRA ) || ( @echo Error calling COPY_XTRA && @goto :END )
@echo. @echo.
:: WIX is not necessary for a snapshot build, so we don't throw :: WIX is not necessary for a snapshot build, so we don't throw
:: an error if WIX is not defined. On the other hand, :: an error if WIX is not defined. On the other hand,
:: if it is there anyway, use it. :: if it is there anyway, use it.
if defined WIX ( @if defined WIX (
@echo Building MSI runtimes echo Building MSI runtimes
@(@call :BUILD_CRT_MSI ) || (@echo Error calling BUILD_CRT_MSI && @goto :END) ( call :BUILD_CRT_MSI ) || ( echo Error calling BUILD_CRT_MSI & @goto :END )
@echo. echo.
) )
@echo Prepare include directory @echo Prepare include directory
@(@call :INCLUDE_DIR ) || (@echo Error calling INCLUDE_DIR && @goto :END) @( call :INCLUDE_DIR ) || ( @echo Error calling INCLUDE_DIR & @goto :END )
@echo. @echo.
@echo Writing databases conf @echo Writing databases conf
@(@call :DB_CONF ) || (@echo Error calling DB_CONF && @goto :END) @(call :DB_CONF ) || ( echo Error calling DB_CONF & goto :END )
@echo. @echo.
@echo Copying firebird.msg @echo Copying firebird.msg
@(@call :FB_MSG ) || (@echo Error calling FB_MSG && @goto :END) @(call :FB_MSG ) || ( echo Error calling FB_MSG & goto :END )
@echo. @echo.
@echo Fix up line endings... @echo Fix up line endings...
@(@call :SET_CRLF ) || (@echo Error calling SET_CRLF && @goto :EOF) @( call :SET_CRLF ) || ( echo Error calling SET_CRLF & goto :EOF )
@echo. @echo.
if %FBBUILD_ZIP_PACK% EQU 1 ( @if %FBBUILD_ZIP_PACK% EQU 1 (
@echo Zipping files for zip pack echo Zipping files for zip pack
@(@call :ZIP_PACK ) || (@echo Error calling ZIP_PACK && @goto :END) ( call :ZIP_PACK ) || ( echo Error calling ZIP_PACK & goto :END )
@echo. echo.
) )
if %FBBUILD_ISX_PACK% EQU 1 ( @if %FBBUILD_ISX_PACK% EQU 1 (
@echo Now let's compile the InnoSetup scripts echo Now let's compile the InnoSetup scripts
@(@call :ISX_PACK ) || (@echo Error calling ISX_PACK && @goto :END) ( call :ISX_PACK ) || ( echo Error calling ISX_PACK & goto :END )
@echo. echo.
) )
@(@call :DO_MD5SUMS ) || (@echo Error calling DO_MD5SUMS && @goto :END) @( call :DO_MD5SUMS ) || ( echo Error calling DO_MD5SUMS & goto :END)
@echo. @echo.
@echo Completed building installation kit(s) @echo Completed building installation kit(s)
@ -702,7 +689,6 @@ if %FBBUILD_ISX_PACK% EQU 1 (
:: because run_all.bat will check for ERRLEV :: because run_all.bat will check for ERRLEV
@set ERRLEV= @set ERRLEV=
::@if %FB2_ISS_DEBUG% equ 0 (ENDLOCAL)
::End of MAIN ::End of MAIN
::----------- ::-----------
@goto :END @goto :END