changeset 7767:0339d0fb77b2

* gnulib-tool (SORT): Remove, since we no longer assume GNU sort. Rewrite so as not to assume GNU sort. Also, don't assume the C locale, and avoid an "eval" that could cause trouble.
author Paul Eggert <eggert@cs.ucla.edu>
date Sun, 31 Dec 2006 06:29:50 +0000
parents 39cff82ec38c
children 22b5aec86335
files ChangeLog gnulib-tool
diffstat 2 files changed, 11 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-12-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+	* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
+	Rewrite so as not to assume GNU sort.  Also, don't assume
+	the C locale, and avoid an "eval" that could cause trouble.
+
 	* lib/getpagesize.h (getpagesize) [defined __amigaos4__]:
 	Define.  Trivial patch from Henning Nielsen Lund, originally
 	sent to bug-grep@gnu.org today.
--- a/gnulib-tool
+++ b/gnulib-tool
@@ -22,7 +22,7 @@
 
 progname=$0
 package=gnulib
-cvsdatestamp='$Date: 2006-12-26 18:42:09 $'
+cvsdatestamp='$Date: 2006-12-31 06:29:50 $'
 last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'`
 version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'`
 nl='
@@ -66,12 +66,6 @@
   AUTOPOINT="${GETTEXTPATH}autopoint"
 fi
 
-# GNU sort is needed. Set SORT to its location (not needed if it's called
-# 'sort' and already in the PATH).
-if test -z "$SORT"; then
-  SORT=sort
-fi
-
 # When using GNU sed, turn off as many GNU extensions as possible,
 # to minimize the risk of accidentally using non-portable features.
 # However, do this only for gnulib-tool itself, not for the code that
@@ -699,11 +693,14 @@
       s,^dnl .*$,,
       s, dnl .*$,,
       /AC_PREREQ/ {
-        s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,prereqs="$prereqs \1",p
+        s,^.*AC_PREREQ([[ ]*\([^])]*\).*$,\1,p
       }'
-    eval `sed -n -e "$my_sed_traces" < "$configure_ac"`
+    prereqs=`sed -n -e "$my_sed_traces" < "$configure_ac"`
     if test -n "$prereqs"; then
-      autoconf_minversion=`for version in $prereqs; do echo $version; done | $SORT -g -u | tail -1`
+      autoconf_minversion=`
+        for version in $prereqs; do echo $version; done |
+        LC_ALL=C sort -nu | sed 1q
+      `
     fi
   fi
   if test -z "$autoconf_minversion"; then