[haiku-commits] haiku: hrev45159 - build/scripts

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Tue, 15 Jan 2013 01:43:26 +0100 (CET)

hrev45159 adds 1 changeset to branch 'master'
old head: 2856aca93f56dc396501293dd01638be2d1270aa
new head: d86bc7f95e3f0fe8bf3527737cfc7c8ef0bbde70
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=d86bc7f+%5E2856aca

----------------------------------------------------------------------------

d86bc7f: If can't find hrev tags set the version to the short hash
  
  If no hrev tags are found the revision is blank and shows up as
  0 in About System. This commit updates the revision function so that
  it falls back to the current short hash instead. Only affects devel
  builds and only if you've deleted your tags.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

Revision:    hrev45159
Commit:      d86bc7f95e3f0fe8bf3527737cfc7c8ef0bbde70
URL:         http://cgit.haiku-os.org/haiku/commit/?id=d86bc7f
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Tue Jan 15 00:37:56 2013 UTC

----------------------------------------------------------------------------

1 file changed, 6 insertions(+), 3 deletions(-)
build/scripts/determine_haiku_revision | 9 ++++++---

----------------------------------------------------------------------------

diff --git a/build/scripts/determine_haiku_revision 
b/build/scripts/determine_haiku_revision
index f10e791..012c090 100644
--- a/build/scripts/determine_haiku_revision
+++ b/build/scripts/determine_haiku_revision
@@ -8,7 +8,7 @@ determineGitRevision()
        revision=`cat ${haikuBuildOutputDir}/haiku-revision 2>/dev/null`
        lastBuiltRevision=`cat ${haikuBuildOutputDir}/last-built-revision \
                2>/dev/null`
-       localRev=`git rev-list -n1 HEAD`
+       localRev=`git rev-parse HEAD`
 
        # only determine the haiku-revision if anything has changed from
        # last build
@@ -16,7 +16,10 @@ determineGitRevision()
                # the revision we use is the description of HEAD with respect 
to the
                # last reachable hrev-(haiku-revision-)tag
                revision=`git describe --dirty --tags --match=hrev*`
-               if echo "$revision" | grep -- '-' >/dev/null; then
+               if [ -z "$revision" ]; then
+                       # failed to find any hrev tags, use short hash instead
+                       revision=`git rev-parse --short HEAD`
+               elif echo "$revision" | grep -- '-' >/dev/null; then
                        # HEAD is not directly a changeset from Haiku's central 
repo, so we
                        # add the current branch name as additional info
                        branchName=`git branch | grep '*' | cut -b 3-`
@@ -59,7 +62,7 @@ determineHaikuRevision()
                        grep --max-count=1 "(svn r" |
                        $SED -n -e 's,(svn r\(.*\)).*,\1,p'`
        fi
-       if [ "$revision" = "" ]; then
+       if [ -z "$revision" ]; then
                revision=0
        fi
        echo $revision >${haikuBuildOutputDir}/haiku-revision


Other related posts:

  • » [haiku-commits] haiku: hrev45159 - build/scripts - jscipione