Port to hosts whose 'sort' and 'tail' implementations treat operands with leading...
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 7 Jul 2006 21:20:12 +0000 (21:20 +0000)
committerMike Stump <mrs@gcc.gnu.org>
Fri, 7 Jul 2006 21:20:12 +0000 (21:20 +0000)
Port to hosts whose 'sort' and 'tail' implementations
treat operands with leading '+' as file names, as POSIX
has required since 2001.  However, make sure the code still
works on pre-POSIX hosts.
* libjava/classpath/ltmain.sh: Don't assume "sort +2" is
equivalent to "sort -k 3", since POSIX 1003.1-2001 no longer
requires this.
This uses the same fix that is already in
libjava/libltdl/ltmain.sh.

From-SVN: r115271

libjava/classpath/ChangeLog
libjava/classpath/ltmain.sh

index 82e756bd730c3d8dee4226344360d19e3f82980c..4e401a4a3cc9288b0ad456ad754da7841f6997fd 100644 (file)
@@ -1,3 +1,15 @@
+2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port to hosts whose 'sort' and 'tail' implementations
+       treat operands with leading '+' as file names, as POSIX
+       has required since 2001.  However, make sure the code still
+       works on pre-POSIX hosts.
+       * libjava/classpath/ltmain.sh: Don't assume "sort +2" is
+       equivalent to "sort -k 3", since POSIX 1003.1-2001 no longer
+       requires this.
+       This uses the same fix that is already in
+       libjava/libltdl/ltmain.sh.
+
 2006-07-04  Peter O'Gorman  <peter@pogma.com>
 
        * ltconfig: chmod 644 before ranlib during install.
index 219823fc45db08bcbb44cda74651d3f1e8a2c0b6..a3c55f9a7513048bf549ec98b8a6a1d18e44c733 100644 (file)
@@ -3839,7 +3839,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