From: Paul Eggert Date: Mon, 7 Aug 2017 06:24:10 +0000 (-0700) Subject: git-version-gen: another fix for tags with "-" X-Git-Tag: v1.0~6020 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=d93aa1d57da743aa23593482b70befb15258f630;p=gnulib.git 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 --- diff --git a/ChangeLog b/ChangeLog index 8282f2e3e5..37daf4cc8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2017-08-06 Paul Eggert + + 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 warnings, manywarnings: Add support for multiple languages, not just C. diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen index e6c329d10f..a8818b217b 100755 --- a/build-aux/git-version-gen +++ b/build-aux/git-version-gen @@ -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