Improve git-version-stamp's error messages

This commit is contained in:
Daniel Hahler 2015-06-10 18:25:20 +02:00
parent f9a3b97b50
commit 256ecd4d8e
1 changed files with 9 additions and 7 deletions

View File

@ -7,17 +7,19 @@
die() die()
{ {
echo "$0: WARNING: version stamp update failed." echo "$0: WARNING: version stamp update failed: $1."
#exit 1 # not important enough to stop the build. #exit 1 # not important enough to stop the build.
exit 0 exit 0
} }
STAMP=`cat "$1" 2> /dev/null` STAMP=`cat "$1" 2> /dev/null`
CURRENT=`git describe --dirty 2>/dev/null` if [ -z "$STAMP" ]; then
die "Missing STAMP: $1"
fi
if [ -z "$STAMP" -o -z "$CURRENT" ] CURRENT=`git describe --dirty 2>/dev/null`
then if [ -z "$CURRENT" ]; then
die die "git describe failed: $(git describe --dirty)."
fi fi
if [ "$STAMP" != "$CURRENT" ] if [ "$STAMP" != "$CURRENT" ]