Add mercurial revision to custom build olsrds and tarballs
authorHenning Rogge <rogge@fgan.de>
Wed, 14 Jan 2009 17:45:35 +0000 (18:45 +0100)
committerHenning Rogge <rogge@fgan.de>
Wed, 14 Jan 2009 17:45:35 +0000 (18:45 +0100)
Makefile
scripts/mk-tarball.sh

index 017892e..eadc4f4 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -73,7 +73,8 @@ show-ignored-warnings:
 src/builddata.c:
        @$(RM) "$@"
        @echo "#include \"defs.h\"" >> "$@" 
-       @echo "const char olsrd_version[] = \"olsr.org - $(VERS)\";" >> "$@" 
+       @echo -n "const char olsrd_version[] = \"olsr.org - $(VERS)" >> "$@"
+       @echo "`hg log -r tip|grep changeset|sed -e s/changeset:\ */\ changeset\ /`\";"  >> "$@" 
        @date +"const char build_date[] = \"%Y-%m-%d %H:%M:%S\";" >> "$@" 
        @echo "const char build_host[] = \"$(shell hostname)\";" >> "$@" 
 
index 21a6e44..764ec4c 100755 (executable)
 #
 
 # first determine the tarball name
+VERS=`grep -E "^VERS" ../Makefile | sed 's/^VERS\ *//'`
 NAME=`grep -E "^VERS" ../Makefile | sed 's/^VERS..../olsrd-/;s/ *$//'`
+CHGSET=`hg log -r tip|grep changeset|sed -e s/changeset:\ */\changeset\ /`
+
 #empty the directory in case it exists already
 rm -rf /tmp/$NAME
 mkdir /tmp/$NAME
@@ -51,6 +54,7 @@ mkdir /tmp/$NAME
 cd ..;make uberclean
 # sync the stuff to a working directory
 rsync -a . /tmp/$NAME/ --exclude=.hg* --exclude=*.rej --delete
+sed -i -e "s/^VERS.*$/VERS $VERS $CHGSET/" /tmp/$NAME/Makefile
 cd /tmp/
 echo "### creating /tmp/$NAME.tar.gz"
 tar -czf /tmp/$NAME.tar.gz $NAME