File: git-version-gen

package info (click to toggle)
ndctl 81-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,436 kB
  • sloc: ansic: 41,432; sh: 3,931; makefile: 28
file content (18 lines) | stat: -rwxr-xr-x 290 bytes parent folder | download | duplicates (7)
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
}