summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@lsd.ic.unicamp.br>2012-11-26 13:13:45 -0800
committerSage Weil <sage@inktank.com>2012-11-26 15:04:08 -0800
commita37c34debdfc6277d5829ab96190b03e87acea4d (patch)
treedd49fcb3c71a9207b08f5607030db266e86ec191
parent74b2a2d9641b6b1d3572d4706fa0cae34ea9e130 (diff)
downloadceph-a37c34debdfc6277d5829ab96190b03e87acea4d.tar.gz
Search for srcdir/.git in check_version
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>
-rwxr-xr-xsrc/check_version9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/check_version b/src/check_version
index e31ca498dab..8600c556f4c 100755
--- a/src/check_version
+++ b/src/check_version
@@ -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