hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r740425 - in /hadoop/hbase/trunk: CHANGES.txt src/saveVersion.sh
Date Tue, 03 Feb 2009 20:33:50 GMT
Author: jdcryans
Date: Tue Feb  3 20:33:49 2009
New Revision: 740425

URL: http://svn.apache.org/viewvc?rev=740425&view=rev
Log:
HBASE-1181  src/saveVersion.sh bails on non-standard Bourne shells (e.g. dash)
            (K M via Jean-Daniel Cryans)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/src/saveVersion.sh

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=740425&r1=740424&r2=740425&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Tue Feb  3 20:33:49 2009
@@ -15,6 +15,8 @@
                sync (temporary until HADOOP-4379 is resolved)
    HBASE-1121  Cluster confused about where -ROOT- is
    HBASE-1148  Always flush HLog on root or meta region updates
+   HBASE-1181  src/saveVersion.sh bails on non-standard Bourne shells (e.g. dash)
+               (K M via Jean-Daniel Cryans)
 
   IMPROVEMENTS
    HBASE-1089  Add count of regions on filesystem to master UI; add percentage

Modified: hadoop/hbase/trunk/src/saveVersion.sh
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/src/saveVersion.sh?rev=740425&r1=740424&r2=740425&view=diff
==============================================================================
--- hadoop/hbase/trunk/src/saveVersion.sh (original)
+++ hadoop/hbase/trunk/src/saveVersion.sh Tue Feb  3 20:33:49 2009
@@ -18,24 +18,37 @@
 
 # This file is used to generate the annotation of package info that
 # records the user, url, revision and timestamp.
-#
-# Copied from hadoop.
+
+# Copied from hadoop core r740386
+
 unset LANG
 unset LC_CTYPE
 version=$1
-if [[ -d .svn ]]; then
+user=`whoami`
+date=`date`
+cwd=`pwd`
+if [ -d .svn ]; then
   revision=`svn info | sed -n -e 's/Last Changed Rev: \(.*\)/\1/p'`
   url=`svn info | sed -n -e 's/URL: \(.*\)/\1/p'`
-elif [[ -d .git ]]; then
-  revision=`git rev-list --max-count=1 HEAD`
-  url=`git config --get remote.origin.url`
+  # Get canonical branch (branches/X, tags/X, or trunk)
+  branch=`echo $url | sed -n -e 's,.*\(branches/.*\)$,\1,p' \
+                             -e 's,.*\(tags/.*\)$,\1,p' \
+                             -e 's,.*trunk$,trunk,p'`
+elif [ -d .git ]; then
+  revision=`git log -1 --pretty=format:"%H"`
+  hostname=`hostname`
+  branch=`git branch | sed -n -e 's/^* //p'`
+  url="git://${hostname}${cwd}"
+else
+  revision="Unknown"
+  branch="Unknown"
+  url="file://$cwd"
 fi
-user=`whoami`
-date=`date`
 mkdir -p build/src/org/apache/hadoop/hbase
 cat << EOF | \
   sed -e "s/VERSION/$version/" -e "s/USER/$user/" -e "s/DATE/$date/" \
       -e "s|URL|$url|" -e "s/REV/$revision/" \
+      -e "s|BRANCH|$branch|" \
       > build/src/org/apache/hadoop/hbase/package-info.java
 /*
  * Generated by src/saveVersion.sh



Mime
View raw message