3 # $1 file containing the last git-describe output
4 # $2 the file in which to update the version string
6 # TODO: proper error handling
10 echo "$0: WARNING: version stamp update failed."
11 #exit 1 # not important enough to stop the build.
15 STAMP
=`cat "$1" 2> /dev/null`
16 CURRENT
=`git describe 2>/dev/null`
18 if [ -z "$STAMP" -o -z "$CURRENT" ]
23 if [ "$STAMP" != "$CURRENT" ]
25 echo "git version changed: $STAMP -> $CURRENT"
26 sed -e s
/$STAMP/$CURRENT/g
"$2" 1> "$2.new" || die
28 echo -n "$CURRENT" > "$1"