* gnulib-tool (SORT): Remove, since we no longer assume GNU sort.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 31 Dec 2006 06:29:50 +0000 (06:29 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 31 Dec 2006 06:29:50 +0000 (06:29 +0000)
Rewrite so as not to assume GNU sort.  Also, don't assume
the C locale, and avoid an "eval" that could cause trouble.

ChangeLog
gnulib-tool

index d516f93c2edc0c60fb8d215f1cc9e6ae39fbe73f..8aa538bbbf137062609e1747152b491effd51441 100644 (file)
--- 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.
index 922fa8e91606db01cde7c7e76562ae288afb419c..6c7f50b4fdb18d0164d421fa2566f1f5052b062a 100755 (executable)
@@ -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 @@ if test -z "${AUTOPOINT}" || test -n "${GETTEXTPATH}"; then
   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 @@ func_ln_if_changed ()
       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