>Description:
        The new POSIX standard is now official (IEEE Std 1003.1-2001),
        and it has removed support for some obsolete utility options
        that mysql uses in a few places.  Basically, the new POSIX
        has removed digit-string options (e.g., "tail -1") and options
        beginning with "+" (e.g., "sort +1").  I'm using an experimental
        environment that insists on the new standard, so I tend to run
        into these problems before other people do.
>How-To-Repeat:
        Build and run Mysql on a host that insists on POSIX 1003.1-2001
        semantics.
>Fix:

2002-02-22  Paul Eggert  <[EMAIL PROTECTED]>

        * bdb/dist/s_recover: Use the standard -k option if it works;
        otherwise fall back on the traditional notation.

        * bdb/dist/s_recover, mysql-test/mysql-test-run.sh,
        sql-bench/server-cfg.sh: Don't use head -1.

        * scripts/safe_mysqld.sh: Don't use tail -1.

===================================================================
RCS file: bdb/dist/s_recover,v
retrieving revision 3.23.49.0
retrieving revision 3.23.49.1
diff -pu -r3.23.49.0 -r3.23.49.1
--- bdb/dist/s_recover  2001/04/18 08:45:53     3.23.49.0
+++ bdb/dist/s_recover  2002/02/22 23:56:22     3.23.49.1
@@ -12,6 +12,13 @@ rm -f $loglist
 
 trap 'rm -f $t; exit 1' 1 2 3 13 15
 
+# Use the standard -k option if it works;
+# otherwise fall back on the traditional notation.
+if sort -k 1,1 /dev/null
+then sort_2_etc='-k 2'
+else sort_2_etc='+1'
+fi
+
 # Check to make sure we haven't duplicated a log record entry, and build
 # the list of log record types that the test suite uses.
 for i in $DIR; do
@@ -19,13 +26,14 @@ for i in $DIR; do
        for f in ../$i/*.src; do
                # Grab the PREFIX;  there should only be one per file, and
                # so it's okay to just take the first.
-               grep '^PREFIX' $f | head -1
+               grep '^PREFIX' $f | sed q
                egrep '^DEPRECATED[      ]|^BEGIN[       ]' $f | \
                    awk '{print $1 "\t" $2 "\t" $3}'
 
        done
 done > $loglist
-grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | sort +1 -n | \
+grep -v '^PREFIX' $loglist | awk '{print $2 "\t" $3}' | \
+    sort $sort_2_etc -n | \
     uniq -d -f 1 > $t
 [ -s $t ] && {
        echo "DUPLICATE LOG VALUES:"
===================================================================
RCS file: mysql-test/mysql-test-run.sh,v
retrieving revision 3.23.49.0
retrieving revision 3.23.49.1
diff -pu -r3.23.49.0 -r3.23.49.1
--- mysql-test/mysql-test-run.sh        2002/02/14 17:30:24     3.23.49.0
+++ mysql-test/mysql-test-run.sh        2002/02/22 23:56:22     3.23.49.1
@@ -44,21 +44,22 @@ which ()
 
 # No paths below as we can't be sure where the program is!
 
-BASENAME=`which basename | head -1`
-DIFF=`which diff | head -1`
+SED=sed
+
+BASENAME=`which basename | $SED q`
+DIFF=`which diff | $SED q`
 CAT=cat
 CUT=cut
 TAIL=tail
 ECHO=echo # use internal echo if possible
 EXPR=expr # use internal if possible
 FIND=find
-GCOV=`which gcov | head -1`
+GCOV=`which gcov | $SED q`
 PRINTF=printf
 RM=rm
 TIME=time
 TR=tr
-XARGS=`which xargs | head -1`
-SED=sed
+XARGS=`which xargs | $SED q`
 
 # Are we using a source or a binary distribution?
 
===================================================================
RCS file: scripts/safe_mysqld.sh,v
retrieving revision 3.23.49.0
retrieving revision 3.23.49.1
diff -pu -r3.23.49.0 -r3.23.49.1
--- scripts/safe_mysqld.sh      2002/02/14 17:30:15     3.23.49.0
+++ scripts/safe_mysqld.sh      2002/02/22 23:56:22     3.23.49.1
@@ -253,7 +253,7 @@ do
     I=1
     while test "$I" -le "$numofproces"
     do 
-      PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | tail -1` 
+      PROC=`ps xa | grep $ledir/$MYSQLD | grep -v "grep" | sed -n '$p'` 
        for T in $PROC
        do
          break
===================================================================
RCS file: sql-bench/server-cfg.sh,v
retrieving revision 3.23.49.0
retrieving revision 3.23.49.1
diff -pu -r3.23.49.0 -r3.23.49.1
--- sql-bench/server-cfg.sh     2002/02/14 17:30:18     3.23.49.0
+++ sql-bench/server-cfg.sh     2002/02/22 23:56:22     3.23.49.1
@@ -932,7 +932,7 @@ sub version
   {
     if ($dir && -e "$dir/bin/solcon")
     {
-      $version=`$dir/bin/solcon -e"ver" $main::opt_user $main::opt_password | grep 
Server | head -1`;
+      $version=`$dir/bin/solcon -e"ver" $main::opt_user $main::opt_password | grep 
+Server | sed q`;
       if ($? == 0)
       {
        chomp($version);

>Submitter-Id:  [EMAIL PROTECTED]
>Originator:    
>Organization:
 Twin Sun, Inc.
>MySQL support: none
>Synopsis:      mysql 3.23.49 porting problem on POSIX 1003.1-2001 hosts
>Severity:      non-critical
>Priority:      low
>Category:      mysql
>Class:         sw-bug
>Release:       mysql-3.23.49 (Source distribution)

>Environment:
        
System: SunOS sic.twinsun.com 5.8 Generic_108528-13 sun4u sparc 
SUNW,UltraSPARC-IIi-Engine
Architecture: sun4

Some paths:  /usr/bin/perl /usr/ccs/bin/make /opt/reb/bin/gmake /opt/reb/bin/gcc 
/opt/SUNWspro/bin/cc
GCC: Reading specs from /opt/reb/lib/gcc-lib/sparc-sun-solaris2.8/3.0.3/specs
Configured with: ../gcc-3.0.3/configure --disable-nls --enable-languages=c,c++ 
--prefix=/opt/reb --with-local-prefix=/opt/reb --with-system-zlib
Thread model: posix
gcc version 3.0.3
Compilation info: CC='gcc'  CFLAGS=''  CXX='gcc'  CXXFLAGS=''  LDFLAGS=''
LIBC: 
-rw-r--r--   1 root     bin      1768120 Feb 11 12:45 /lib/libc.a
lrwxrwxrwx   1 root     root          11 May  8  2001 /lib/libc.so -> ./libc.so.1
-rwxr-xr-x   1 root     bin      1146392 Feb 11 12:45 /lib/libc.so.1
-rw-r--r--   1 root     bin      1768120 Feb 11 12:45 /usr/lib/libc.a
lrwxrwxrwx   1 root     root          11 May  8  2001 /usr/lib/libc.so -> ./libc.so.1
-rwxr-xr-x   1 root     bin      1146392 Feb 11 12:45 /usr/lib/libc.so.1
Configure command: ./configure  --with-unix-socket-path=/var/tmp/mysql.sock 
--with-low-memory --with-mit-threads=yes --without-perl --enable-thread-safe-client 
--with-berkeley-db --enable-local-infile --with-innodb
Perl: This is perl, version 5.005_03 built for sun4-solaris

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to