summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xgen-version.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/gen-version.sh b/gen-version.sh
index 739c83e..3a08015 100755
--- a/gen-version.sh
+++ b/gen-version.sh
@@ -1,20 +1,20 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# Get version-info specified in Makefile 3# Get version-info specified in Makefile
4V=$1 4V=$1
5 5
6# Use `git describe` to get current version if we're inside a git repo 6# Use `git describe` to get current version if we're inside a git repo
7if test -d .git 7if test -d .git
8then 8then
9 V=$(git describe --abbrev=4 HEAD 2>/dev/null | sed -e 's/-/./g') 9 V=$(git describe --abbrev=4 HEAD 2>/dev/null)
10fi 10fi
11 11
12new="CGIT_VERSION = $V" 12new="CGIT_VERSION = $V"
13old=$(cat VERSION 2>/dev/null) 13old=$(cat VERSION 2>/dev/null)
14 14
15# Exit if VERSION is uptodate 15# Exit if VERSION is uptodate
16test "$old" = "$new" && exit 0 16test "$old" = "$new" && exit 0
17 17
18# Update VERSION with new version-info 18# Update VERSION with new version-info
19echo "$new" > VERSION 19echo "$new" > VERSION
20cat VERSION 20cat VERSION