Skip to content

Commit

Permalink
get the version dynamically (or from git or provided in a version fil…
Browse files Browse the repository at this point in the history
…e in the builddir)

note that the script generating the version number can be improved
  • Loading branch information
xant committed Sep 2, 2015
1 parent 855df46 commit 1ed61ac
Show file tree
Hide file tree
Showing 3 changed files with 669 additions and 9,725 deletions.
28 changes: 28 additions & 0 deletions build-aux/git-version-gen
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

GVF=GIT-VERSION-FILE

LF='
'

# First see if there is a version file (included in release tarballs),
# then try git-describe, then default.
if test -f version
then
VN=$(cat version)
elif
VN=$(git describe --tags --match 'libhl-[0-9]*' --abbrev=7 HEAD 2>/dev/null) &&
case "$VN" in
*$LF*) (exit 1) ;;
v[0-9]*)
git update-index -q --refresh
test -z "$(git diff-index --name-only HEAD --)" ||
VN="$VN-dirty" ;;
esac
then
VN=$(echo "$VN" | sed -e 's/-/./g');
fi

VN=$(expr "$VN" : v*'\(.*\)')

echo "$VN"
Loading

0 comments on commit 1ed61ac

Please sign in to comment.