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()
{
echo "$0: WARNING: version stamp update failed."
#exit 1 # not important enough to stop the build.
exit 0
echo "$0: WARNING: version stamp update failed: $1."
#exit 1 # not important enough to stop the build.
exit 0
}
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" ]
then
die
CURRENT=`git describe --dirty 2>/dev/null`
if [ -z "$CURRENT" ]; then
die "git describe failed: $(git describe --dirty)."
fi
if [ "$STAMP" != "$CURRENT" ]