]> Savannah Git Hosting - gnulib.git/commitdiff
git-version-gen: another fix for tags with "-"
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Aug 2017 06:24:10 +0000 (23:24 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 7 Aug 2017 06:24:39 +0000 (23:24 -0700)
* build-aux/git-version-gen: Improve fix for tags containing "-".
Suggested by Markus Armbruster in:
http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00034.html

ChangeLog
build-aux/git-version-gen

index 8282f2e3e545f2896db1c921083587d8a77929c4..37daf4cc8e0e12936447c157fb74c27ff4fe698b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-08-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       git-version-gen: another fix for tags with "-"
+       * build-aux/git-version-gen: Improve fix for tags containing "-".
+       Suggested by Markus Armbruster in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2017-08/msg00034.html
+
 2017-08-06  Bruno Haible  <bruno@clisp.org>
 
        warnings, manywarnings: Add support for multiple languages, not just C.
index e6c329d10f96624ef10bf12c1845d4af325b1596..a8818b217bed437253847908d6637a19dfed01f4 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2017-08-06.16; # UTC
+scriptversion=2017-08-07.06; # UTC
 
 # Copyright (C) 2007-2017 Free Software Foundation, Inc.
 #
@@ -184,9 +184,9 @@ then
             ;;
     esac
 
-    # Change the first '-' to a '.', so version-comparing tools work properly.
-    # Remove the "g" in git describe's output string, to save a byte.
-    v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
+    # Change the penultimate "-" to ".", for version-comparing tools.
+    # Remove the "g" to save a byte.
+    v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
     v_from_git=1
 elif test "x$fallback" = x || git --version >/dev/null 2>&1; then
     v=UNKNOWN