]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Search for srcdir/.git in check_version
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>
Mon, 26 Nov 2012 21:13:45 +0000 (13:13 -0800)
committerSage Weil <sage@inktank.com>
Mon, 26 Nov 2012 23:04:08 +0000 (15:04 -0800)
Support srcdir != . looking for .git in srcdir when computing the ceph
release and git tag.

Signed-off-by: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
src/check_version

index e31ca498dab3dd8394e3cf1c1c0a55420eabd8c0..8600c556f4c0b7ffb6ed3bf91f1ec08fe65cfb9f 100755 (executable)
@@ -1,12 +1,13 @@
 #!/bin/sh
 
-if [ ! -d ../.git ]; then
-    echo "not updating .git_version (no ../.git)"
+dname=`dirname $0`
+
+if [ ! -d $dname/../.git ]; then
+    echo "not updating .git_version (no $dname/../.git)"
     exit 0
 fi
 
-dname=`dirname $0`
-cur=`git rev-parse HEAD 2>/dev/null; git describe 2>/dev/null`
+cur=`cd $dname && git rev-parse HEAD 2>/dev/null; git describe 2>/dev/null`
 [ -e $1 ] && old=`cat $1`
 
 if [ "$cur" != "$old" ]; then