forked from xant/libhl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
get the version dynamically (or from git or provided in a version fil…
…e in the builddir) note that the script generating the version number can be improved
- Loading branch information
Showing
3 changed files
with
669 additions
and
9,725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
Oops, something went wrong.