8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-25 05:23:02 +01:00
firebird-mirror/src/misc/writeBuildNum.sh

112 lines
2.7 KiB
Bash
Raw Normal View History

2001-08-15 10:44:11 +02:00
#!/bin/sh
# This file is used both to rebuild the header file and to set the
# environment variables on the config call
2003-08-02 00:03:12 +02:00
BuildVersion="$Id: writeBuildNum.sh,v 1.4055 2003-08-01 22:03:12 fsg Exp $"
2001-08-15 10:44:11 +02:00
BuildType=T
2002-08-27 13:23:32 +02:00
MajorVer=1
2003-07-17 10:47:22 +02:00
MinorVer=6
2001-08-15 10:44:11 +02:00
RevNo=0
2003-08-02 00:03:12 +02:00
BuildNum=4057
2003-07-17 10:47:22 +02:00
BuildSuffix="Firebird 1.6 Alpha 1"
FIREBIRD_PACKAGE_VERSION=0.Alpha1
2001-08-15 10:44:11 +02:00
FIREBIRD_VERSION="$MajorVer.$MinorVer.$RevNo"
PRODUCT_VER_STRING="$MajorVer.$MinorVer.$RevNo.$BuildNum"
FILE_VER_STRING="WI-$BuildType$MajorVer.$MinorVer.$RevNo.$BuildNum"
FILE_VER_NUMBER="$MajorVer, $MinorVer, $RevNo, $BuildNum"
if [ $# -eq 3 ]
then
headerFile=$2
tempfile=$3;
else
tempfile=gen/test.header.txt
headerFile=src/jrd/build_no.h;
fi
2001-08-15 10:44:11 +02:00
#______________________________________________________________________________
# Routine to build a new jrd/build_no.h file. If required.
rebuildHeaderFile() {
cat > $tempfile <<eof
/*
FILE GENERATED BY src/misc/writeBuildNum.sh
*** DO NOT EDIT ***
2001-08-15 10:44:11 +02:00
TO CHANGE ANY INFORMATION IN HERE PLEASE
EDIT src/misc/writeBuildNum.sh
2001-08-15 10:44:11 +02:00
FORMAL BUILD NUMBER:$BuildNum
*/
#define PRODUCT_VER_STRING "$PRODUCT_VER_STRING"
#define FILE_VER_STRING "$FILE_VER_STRING"
#define LICENSE_VER_STRING "$FILE_VER_STRING"
#define FILE_VER_NUMBER $FILE_VER_NUMBER
#define FB_MAJOR_VER "$MajorVer"
#define FB_MINOR_VER "$MinorVer"
#define FB_REV_NO "$RevNo"
#define FB_BUILD_NO "$BuildNum"
#define FB_BUILD_TYPE "$BuildType"
#define FB_BUILD_SUFFIX "$BuildSuffix"
eof
cmp -s $headerFile $tempfile
2001-08-15 10:44:11 +02:00
Result=$?
if [ $Result -lt 0 ]
then
echo "error compareing $tempfile and $headerFile"
elif [ $Result -gt 0 ]
then
echo "updating header file $headerFile"
cp $tempfile $headerFile
else
echo "files are identical"
fi
}
#______________________________________________________________________________
# Routine to build a new gen/make.version file.
createMakeVersion() {
cat >$1 <<eof
# FILE GENERATED BY src/misc/writeBuildNum.sh
# *** DO NOT EDIT ***
# TO CHANGE ANY INFORMATION IN HERE PLEASE
# EDIT src/misc/writeBuildNum.sh
# FORMAL BUILD NUMBER:$BuildNum
MajorVer = $MajorVer
MinorVer = $MinorVer
RevNo = $RevNo
2003-08-02 00:03:12 +02:00
BuildNum=4057
BuildType = $BuildType
BuildSuffix = $BuildSuffix
2001-08-15 10:44:11 +02:00
PackageVersion=$FIREBIRD_PACKAGE_VERSION
FirebirdVersion=$FIREBIRD_VERSION
eof
}
2001-08-15 10:44:11 +02:00
if [ "$1" = "rebuildHeader" ]
2001-08-15 10:44:11 +02:00
then
rebuildHeaderFile
elif [ "$1" = "createMakeVersion" ]
then
if [ -z "$2" ]
then createMakeVersion gen/Make.Version
else createMakeVersion "$2"
fi
2002-07-05 14:07:14 +02:00
elif [ "$1" = "--version" ]
then
2002-07-05 15:10:29 +02:00
echo ""
2002-07-05 14:22:58 +02:00
echo "Build Version : " $BuildType$PRODUCT_VER_STRING $BuildSuffix
2002-07-05 15:10:29 +02:00
echo ""
2002-07-05 15:02:57 +02:00
#echo "($BuildVersion)"
echo "(`echo $BuildVersion | cut -c3-60` )"
2001-08-15 10:44:11 +02:00
fi