[pulseaudio-commits] [SCM] PulseAudio Sound Server branch, master, updated. v1.0-dev-15-gba2e5f4

Colin Guthrie gitmailer-noreply at 0pointer.de
Sat Dec 4 09:36:40 PST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because of a push to the "PulseAudio Sound Server" repository.

The master branch has been updated
      from  2a01bab3cc50a6ef02af3872a13d279ad996a0b1 (commit)

- Log -----------------------------------------------------------------
ba2e5f4 build-sys: Add some smarts to version extraction from git tags.
-----------------------------------------------------------------------

Summary of changes:
 git-version-gen |   22 +++++++++++++++-------
 1 files changed, 15 insertions(+), 7 deletions(-)

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

commit ba2e5f4442b8f933f37411cc625598cc72938d33
Author: Colin Guthrie <cguthrie at mandriva.org>
Date:   Sat Dec 4 17:21:27 2010 +0000

    build-sys: Add some smarts to version extraction from git tags.
    
    When we are dealing with a tag against a commit with other tags applied,
    then favour the first tag, not the last one. This allows us to tag a release
    as e.g. v1.0, v1.1-dev and v2.0-dev and get a version of 1.0 rather than the
    newer tags.
    
    This also removes support for git versions that do not accept
    the --match argument as we also now make use of the --contains arg
    which was added at the same time (I think)
    
    Additionally, the v variable is reset just incase it is already exported
    in the shell for some reason.

diff --git a/git-version-gen b/git-version-gen
index ae3988e..1a3d13b 100755
--- a/git-version-gen
+++ b/git-version-gen
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2008-04-08.07
+scriptversion=2008-04-08.07.01
 
 # Copyright (C) 2007-2008 Free Software Foundation
 #
@@ -76,6 +76,7 @@ esac
 tarball_version_file=$1
 nl='
 '
+v=
 
 # First see if there is a tarball-only version file.
 # then try "git describe", then default.
@@ -95,13 +96,20 @@ if test -n "$v"
 then
     : # use $v
 elif test -d .git \
-    && v=`git describe --abbrev=4 --match='v*' HEAD 2>/dev/null \
-	  || git describe --abbrev=4 HEAD 2>/dev/null` \
-    && case $v in
-	 v[0-9]*) ;;
-	 *) (exit 1) ;;
-       esac
+    && v=`git describe --abbrev=4 --match='v[0-9]*' HEAD 2>/dev/null` \
+    && [ -n "$v" ]
 then
+    # If we are on a "dev" tag, we need to check that it is not the same
+    # reference as the a previous version tag (this only happens when we are
+    # working with a release tag).
+    # NB The below trick relies on the $v being an exact tag to work which
+    # will only work when HEAD == tag. When further commits have been made on top
+    # of the tag, the $v will be supplimented with the number of commits since
+    # that tag and the commit ref of the most recent commit and thus will
+    # fail the test below (as intended)
+    v2=`git describe --abbrev=4 --match='v[0-9]\.[0-9]' --contains $v 2>/dev/null | cut -d'^' -f1`
+    [ -n "$v2" ] && v=$v2
+
     # Is this a new git that lists number of commits since the last
     # tag or the previous older version that did not?
     #   Newer: v6.10-77-g0f8faeb

-- 
hooks/post-receive
PulseAudio Sound Server



More information about the pulseaudio-commits mailing list