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

New script to increment buildno.

This commit is contained in:
Dmitry Yemanov 2016-03-24 20:32:34 +03:00
parent 773c7bfe3f
commit 8ac011b1dd
2 changed files with 54 additions and 30 deletions

View File

@ -1,30 +0,0 @@
#!/bin/sh
PositiveOffset=15462 # will be correct for all branches after FB3
# Other values are: 2.5:13820 2.1:9165 2.0:6144 1.5:1748
TmpDir=/var/tmp
TmpLog=${TmpDir}/temp.log
TmpFile=temp.build.num
TmpSmall=${TmpDir}/small.log
WriteBuildNumFile="src/misc/writeBuildNum.sh"
HeaderFile="src/jrd/build_no.h"
cd /home/fbadmin/changelogs/trunk
svn up || exit
svn log -v >$TmpLog || exit
smallog <$TmpLog >$TmpSmall || exit
dd if=$TmpSmall of=ChangeLog bs=512k || exit
VersionCount=`egrep -c '[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}' ChangeLog`
BuildNo=$((${VersionCount}+${PositiveOffset}))
Starting="BuildNum="
NewLine="BuildNum=$BuildNo"
AwkProgram="(/^$Starting.*/ || \$1 == \"$Starting\") {\$0=\"$NewLine\"} {print \$0}"
awk "$AwkProgram" <$WriteBuildNumFile >$TmpFile && mv $TmpFile $WriteBuildNumFile
chmod +x $WriteBuildNumFile
$WriteBuildNumFile rebuildHeader $HeaderFile $TmpFile
svn commit -m "nightly update" ChangeLog $WriteBuildNumFile $HeaderFile
rm -f $TmpLog $TmpFile $TmpSmall

54
setupBuildNum.sh Normal file
View File

@ -0,0 +1,54 @@
#!/bin/sh
v40Filter="--after=15.03.2016"
v30Offset=15471
v25Offset=13822
v21Offset=9146
processBranch() {
Branch="$1"
Adjust="$2"
Filter="$3"
git checkout $Branch
git pull
TmpFile=temp.buildno
WriteBuildNumFile="src/misc/writeBuildNum.sh"
BuildNoFile="src/jrd/build_no.h"
OrgBuildNo=$(grep "FB_BUILD_NO" $BuildNoFile | cut -d'"' -f2)
Count=$(git rev-list $Filter --count $Branch)
Skip1=$(git rev-list $Filter --grep="increment build number" --count $Branch)
Skip2=$(git rev-list $Filter --grep="nightly update" --count $Branch)
NewBuildNo=$(($Count-$Skip1-$Skip2+$Adjust))
if [ "$NewBuildNo" != "$OrgBuildNo" ]; then
Starting="BuildNum="
NewLine="BuildNum=$NewBuildNo"
AwkProgram="(/^$Starting.*/ || \$1 == \"$Starting\") {\$0=\"$NewLine\"} {print \$0}"
awk "$AwkProgram" <$WriteBuildNumFile >$TmpFile && mv $TmpFile $WriteBuildNumFile
chmod +x $WriteBuildNumFile
$WriteBuildNumFile rebuildHeader $BuildNoFile $TmpFile
git commit -m "increment build number" $WriteBuildNumFile $BuildNoFile
rm -f $TmpFile
fi
}
processBranch master 0 $v40Filter
processBranch B3_0_Release $v30Offset
processBranch B2_5_Release $v25Offset
processBranch B2_1_Release $v21Offset
git checkout master
export GIT_COMMITTER_NAME="firebirds"
export GIT_COMMITTER_EMAIL="<>"
export GIT_AUTHOR_NAME="firebirds"
export GIT_AUTHOR_EMAIL="<>"
git push