8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 16:43:03 +01:00
firebird-mirror/setupBuildNum.sh

56 lines
1.4 KiB
Bash
Raw Normal View History

2016-03-24 18:32:34 +01:00
#!/bin/sh
v50Filter="--after=05.05.2021"
v40Filter="--after=28.02.2016"
2016-03-24 18:32:34 +01:00
v30Offset=15471
v25Offset=13822
processBranch() {
Branch="$1"
Adjust="$2"
Filter="$3"
git checkout $Branch
git reset --hard origin/$Branch
git clean -d -x -f
2016-03-24 18:32:34 +01:00
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
}
git fetch --all
processBranch master 0 $v50Filter
2021-05-06 05:50:07 +02:00
processBranch v4.0-release 0 $v40Filter
2016-03-24 18:32:34 +01:00
processBranch B3_0_Release $v30Offset
processBranch B2_5_Release $v25Offset
export GIT_COMMITTER_NAME="firebirds"
export GIT_COMMITTER_EMAIL="<>"
export GIT_AUTHOR_NAME="firebirds"
export GIT_AUTHOR_EMAIL="<>"
2016-03-24 19:17:27 +01:00
git push --all
2016-03-24 18:32:34 +01:00