diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-06 23:24:10 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2017-08-06 23:24:39 -0700 |
commit | d93aa1d57da743aa23593482b70befb15258f630 (patch) | |
tree | 0a65bfcb21ef6429e0da87fbaeb6d256186ddffe /build-aux/git-version-gen | |
parent | 461664a6bef8f774d03dad7273051862541cb87c (diff) | |
download | gnulib-d93aa1d57da743aa23593482b70befb15258f630.tar.gz |
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
Diffstat (limited to 'build-aux/git-version-gen')
-rwxr-xr-x | build-aux/git-version-gen | 8 |
1 files changed, 4 insertions, 4 deletions
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 |