aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/git-version-gen
blob: e913a3674eef3d203cb1e3a0fc514f0e81f92536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

GVF=version.m4

if test -r $GVF; then
	VC=$(sed -e 's/m4_define(\[GIT_VERSION], \[//' <$GVF)
		VC=$(echo $VC | sed -e 's/\])//')
else
	VC=unset
fi

VN=$(./git-version)

test "$VN" = "$VC" || {
	echo >&2 "GIT_VERSION = $VN"
	echo "m4_define([GIT_VERSION], [$VN])" >$GVF
	exit 0
}