File: make-version.sh

package info (click to toggle)
flowgrind 0.8.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 784 kB
  • sloc: ansic: 7,721; sh: 86; makefile: 64; xml: 13
file content (19 lines) | stat: -rwxr-xr-x 419 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

VLINE='/*#define GITVERSION ""*/'
GIT=`which git`
FILE='src/gitversion.h'

cd $(dirname $0)/..

if [ "$GIT" = "" ]; then
	echo "The command 'git' is not installed. Please install git."
elif [ ! -d .git ]; then
	echo "This is not a git release."
else
	VERSION=$($GIT describe --always --abbrev=6)
	VLINE="#define GITVERSION \"$VERSION\""
fi

echo "$VLINE" | cmp -s - "$FILE" || echo "$VLINE" > "$FILE"
exit 0