bug-libtool
[Top][All Lists]
Advanced

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

ltmain.in incompatibility with GNU textutils 2.0.21


From: Paul Eggert
Subject: ltmain.in incompatibility with GNU textutils 2.0.21
Date: Fri, 3 May 2002 23:32:29 -0700 (PDT)

ltmain.in generates a shell script that uses the command `sort +2',
but that isn't portable to textutils 2.0.21 when conforming to POSIX
1003.1-2001 (e.g. if the environment variable _POSIX2_VERSION set to
200112).  For example:

        $ sort +2
        sort: open failed: +2: No such file or directory
        $ sort --version | sed 1q
        sort (textutils) 2.0.21

Here is a patch.  This message is a followup to
<http://mail.gnu.org/pipermail/bug-libtool/2002-February/003050.html>
but I've simplified things by breaking out this one patch and preserving
the existing behavior as much as possible.

2002-05-04  Paul Eggert  <address@hidden>

        * ltmain.in: Don't assume that "sort +2" works, as POSIX
        1003.1-2001 says that "sort +2" is supposed to sort the file
        named "+2".  An example host that behaves like this is
        textutils 2.0.21 with _POSIX2_VERSION=200112.

Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/ltmain.in,v
retrieving revision 1.294
diff -p -u -r1.294 ltmain.in
--- ltmain.in   2 May 2002 20:38:11 -0000       1.294
+++ ltmain.in   4 May 2002 06:28:57 -0000
@@ -3812,7 +3812,13 @@ extern \"C\" {
            fi
 
            # Try sorting and uniquifying the output.
-           if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+           if grep -v "^: " < "$nlist" |
+               if sort -k 3 </dev/null >/dev/null 2>&1; then
+                 sort -k 3
+               else
+                 sort +2
+               fi |
+               uniq > "$nlist"S; then
              :
            else
              grep -v "^: " < "$nlist" > "$nlist"S



reply via email to

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