Be a bit more fail-safe in "build-aux/git-version-gen".
The existence of a ".git" directory is not a sufficient condition to be sure we are in a Git repository. Only overwrite the version information file if `git describe` returns a non-empty string. Signed-off-by: Lukas Fleischer <calcurse@cryptocrack.de>
This commit is contained in:
parent
621b335179
commit
ddd0cb21fa
@ -10,8 +10,9 @@ VERFILE="$1"
|
|||||||
|
|
||||||
if [ -d '.git' ]
|
if [ -d '.git' ]
|
||||||
then
|
then
|
||||||
VERSION=`git describe --abbrev=4 --match='v[0-9]*' --dirty | sed 's/^v//'`
|
VERSION=`git describe --abbrev=4 --match='v[0-9]*' --dirty 2>/dev/null`
|
||||||
echo -n "$VERSION" > "$VERFILE"
|
VERSION=`echo "$VERSION" | sed 's/^v//'`
|
||||||
|
[ -n "$VERSION" ] && echo -n "$VERSION" > "$VERFILE"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f "$VERFILE" ]
|
if [ -f "$VERFILE" ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user