Skip to contentSkip to conversation

Search for srcdir/.git in check_version

PATCH Applied Alexandre Oliva 2 participants 2 messages Aug 14, 2012

lore
Share & tools
lore
#0 lore raw

Support srcdir != . looking for .git in srcdir when computing the ceph release and git tag.

---
 src/check_version |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
src/check_version +5 -4
index e31ca49..8600c55 100755
@@ -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
Signature · 7 lines
1.7.7.6

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer
Applied
#1 lore raw

Applied to next branch (will become v0.51).

Quoted 44 lines · Alexandre Oliva

Support srcdir != . looking for .git in srcdir when computing the ceph release and git tag.

---
 src/check_version |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
src/check_version +5 -4
index e31ca49..8600c55 100755
@@ -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
Signature · 11 lines
1.7.7.6

-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html