]> rtime.felk.cvut.cz Git - jailhouse.git/blobdiff - scripts/gen_version_h
jailhouse: inmates: bench: Add -R option -- repeats count.
[jailhouse.git] / scripts / gen_version_h
index f24aa71b9b0a65cacc1ba464427e1f054336f6a9..2ce0eff9560f9e63c08decf70a4dfef672ea5d91 100755 (executable)
 echo "/* Auto-generated - leave alone and don't commit! */"
 echo ""
 
+cd "$1" > /dev/null
+
 if ! git rev-parse 2>/dev/null; then
-       version="`cat $1/VERSION`"
+       version="`cat VERSION`"
 else
-       cd $1 > /dev/null
        describe="`git describe --long --dirty --match "v[0-9].[0-9]*"`"
        version="`echo $describe | sed -e 's/\([^-]*\)-\(.*\)/\1 (\2)/'`"
-       cd - > /dev/null
 fi
 
+cd - > /dev/null
+
 echo "#define JAILHOUSE_VERSION        \"$version\""