diff --git a/build-utils/git-version-stamp.sh b/build-utils/git-version-stamp.sh index 2703a9c74..5d3684258 100755 --- a/build-utils/git-version-stamp.sh +++ b/build-utils/git-version-stamp.sh @@ -5,22 +5,25 @@ # # TODO: proper error handling -die() { - echo "$0: WARNING: version stamp update failed." - #exit 1 # not important enough to stop the build. - exit 0 +die() +{ + echo "$0: WARNING: version stamp update failed." + #exit 1 # not important enough to stop the build. + exit 0 } STAMP=`cat "$1" 2> /dev/null` CURRENT=`git-describe 2>/dev/null` -if [[ -z "$STAMP" || -z "$CURRENT" ]]; then - die +if [ -z "$STAMP" -o -z "$CURRENT" ] +then + die fi -if [ "$STAMP" != "$CURRENT" ]; then - echo "git version changed: $STAMP -> $CURRENT" - sed -e s/$STAMP/$CURRENT/g "$2" 1> "$2.new" || die - mv "$2.new" "$2" - echo -n "$CURRENT" > "$1" +if [ "$STAMP" != "$CURRENT" ] +then + echo "git version changed: $STAMP -> $CURRENT" + sed -e s/$STAMP/$CURRENT/g "$2" 1> "$2.new" || die + mv "$2.new" "$2" + echo -n "$CURRENT" > "$1" fi