NetBSD-Bugs archive

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

toolchain/37678: sort in build scripts is not POSIX friendly for cross-compilation



>Number:         37678
>Category:       toolchain
>Synopsis:       sort in build scripts is not POSIX friendly for 
>cross-compilation
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 03 10:05:01 +0000 2008
>Originator:     Jeremy Huddleston
>Release:        netbsd-3
>Organization:
UC Berkeley
>Environment:
Linux cloud 2.6.23-hardened-r5 #2 Wed Dec 26 21:13:45 PST 2007 x86_64 AMD 
Athlon(tm) 64 Processor 2800+ AuthenticAMD GNU/Linux

>Description:
some uses of sort in the build process are not POSIX friendly thus causing 
problems when I cross-compile with my linux box.
>How-To-Repeat:

>Fix:
Index: src/bin/ksh/siglist.sh
===================================================================
RCS file: /cvsroot/src/bin/ksh/siglist.sh,v
retrieving revision 1.2
diff -p -u -4 -r1.2 siglist.sh
--- src/bin/ksh/siglist.sh      12 Jan 1997 19:12:18 -0000      1.2
+++ src/bin/ksh/siglist.sh      31 Mar 2007 06:20:10 -0000
@@ -22,9 +22,9 @@ CPP="${1-cc -E}"
  sed -e '/^[    ]*#/d' -e 's/^[         ]*\([^         ][^     ]*\)[    ][     
 ]*\(.*[^       ]\)[    ]*$/#ifdef SIG\1\
        { QwErTy SIG\1 , "\1", "\2" },\
 #endif/') > $in
 $CPP $in  > $out
-sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort +2n +0n |
+sed -n 's/{ QwErTy/{/p' < $out | awk '{print NR, $0}' | sort -n -k 3 -k 1 |
     sed 's/^[0-9]* //' |
     awk 'BEGIN { last=0; nsigs=0; }
        {
            if ($2 ~ /^[0-9][0-9]*$/ && $3 == ",") {
Index: src/dist/ntp/scripts/ntp-close
===================================================================
RCS file: /cvsroot/src/dist/ntp/scripts/ntp-close,v
retrieving revision 1.1.1.1
diff -p -u -4 -r1.1.1.1 ntp-close
--- src/dist/ntp/scripts/ntp-close      4 Dec 2003 16:05:32 -0000       1.1.1.1
+++ src/dist/ntp/scripts/ntp-close      3 Apr 2007 22:11:34 -0000
@@ -2,7 +2,7 @@
 
 lynx -source http://www.eecis.udel.edu/~mills/ntp/clock2.htm |
        sed -n -e 's,).*,,' -e' /([0-9.]*$/s/.*(//p' |
        xargs ntpdate -q |
-       sort -n +7 > /tmp/ntp-close
+       sort -n -k 8 > /tmp/ntp-close
 
 # From: Neal McBurnett <neal%bcn.boulder.co.us@localhost>
Index: src/games/fortune/datfiles/fortunes2
===================================================================
RCS file: /cvsroot/src/games/fortune/datfiles/fortunes2,v
retrieving revision 1.23
diff -p -u -4 -r1.23 fortunes2
--- src/games/fortune/datfiles/fortunes2        30 Jan 2005 13:49:28 -0000      
1.23
+++ src/games/fortune/datfiles/fortunes2        3 Apr 2007 22:12:03 -0000
@@ -15425,9 +15425,9 @@ Egotism, n:
 Egotist, n:
        A person of low taste, more interested in himself than me.
                -- Ambrose Bierce
 %
-egrep -n '^[a-z].*\(' $ | sort -t':' +2.0
+egrep -n '^[a-z].*\(' $ | sort -t':' -k 3.0
 %
 Ehrman's Commentary:
        1.  Things will get worse before they get better.
        2.  Who said things would get better?
Index: src/gnu/dist/toolchain/contrib/compare_tests
===================================================================
RCS file: /cvsroot/src/gnu/dist/toolchain/contrib/Attic/compare_tests,v
retrieving revision 1.1.1.1
diff -p -u -4 -r1.1.1.1 compare_tests
--- src/gnu/dist/toolchain/contrib/compare_tests        26 Jul 2000 00:17:16 
-0000      1.1.1.1
+++ src/gnu/dist/toolchain/contrib/compare_tests        3 Apr 2007 22:12:13 
-0000
@@ -27,10 +27,10 @@ before=$tmp1
 now=$tmp2
 
 trap "rm -f $tmp1 $tmp2 $now_s $before_s" 0 1 2 3 5 9 13 15
 
-sort +0.4 "$now" > "$now_s"
-sort +0.4 "$before" > "$before_s"
+sort -k 1.4 "$now" > "$now_s"
+sort -k 1.4 "$before" > "$before_s"
 
 grep '^FAIL' "$now_s" | sed 's/^....:  //' >$tmp1
 grep '^PASS' "$before_s" | sed 's/^....:       //' | comm -12 $tmp1 - >$tmp2




Home | Main Index | Thread Index | Old Index