bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] do-release-commit-and-tag: use funclib.sh instead of sort -V


From: Gary V. Vaughan
Subject: [PATCH 2/2] do-release-commit-and-tag: use funclib.sh instead of sort -V GNUism.
Date: Sun, 27 Oct 2013 15:03:18 +1300

* build-aux/do-release-commit-and-tag: Source funclib.sh from the
same directory as do-release-commit-and-tag, and then call the
func_sort_ver shell function in lieu of unportable sort -V.

Signed-off-by: Gary V. Vaughan <address@hidden>
---
 build-aux/do-release-commit-and-tag | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/build-aux/do-release-commit-and-tag 
b/build-aux/do-release-commit-and-tag
index 0bd8ce8..e7cfe79 100755
--- a/build-aux/do-release-commit-and-tag
+++ b/build-aux/do-release-commit-and-tag
@@ -5,6 +5,9 @@
 # will serve to identify the release, so apply a signed tag to it as well.
 VERSION=2012-08-01.09 # UTC
 
+# Make sure we've evaluated scripts we depend on.
+test -z "$progpath" && . `echo "$0" |${SED-sed} 's|[^/]*$||'`/funclib.sh
+
 # Note: this is a bash script (could be zsh or dash)
 
 # Copyright (C) 2009-2013 Free Software Foundation, Inc.
@@ -125,10 +128,9 @@ prev_ver=$(cat .prev-version) \
   || die 'failed to determine previous version number from .prev-version'
 
 # Verify that $ver is sensible (> .prev-version).
-case $(printf "$prev_ver\n$ver\n"|sort -V -u|tr '\n' ':') in
-  "$prev_ver:$ver:") ;;
-  *) die "invalid version: $ver (<= $prev_ver)";;
-esac
+newer_ver=$(func_sort_ver $prev_ver $ver |cut -d' ' -f2)
+test "$newer_ver" != "$ver" && \
+  die "invalid version: $ver (<= $prev_ver)"
 
 case $type in
   alpha|beta|stable) ;;
-- 
1.8.4.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]