]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
tooling: Fix gen_version_h to query git support for the correct repository
authorJan Kiszka <jan.kiszka@siemens.com>
Tue, 23 Sep 2014 16:24:10 +0000 (18:24 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Wed, 24 Sep 2014 16:58:09 +0000 (18:58 +0200)
The initial git availability check ran in the kernel directory instead
of the Jailhouse source tree. Fix it by moving the cd before it. Also
quote the input path properly at this chance.

Reported-by: Henning Schild <henning.schild@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
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\""