bug-cvs
[Top][All Lists]
Advanced

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

CVS 1.11.1p1 port to POSIX 1003.1-2001 hosts


From: Paul Eggert
Subject: CVS 1.11.1p1 port to POSIX 1003.1-2001 hosts
Date: Sun, 24 Feb 2002 00:20:10 -0800 (PST)

The new POSIX standard is now official (IEEE Std 1003.1-2001), and it
has removed support for some obsolete utility options that CVS 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.

Here is a proposed patch to port to POSIX 1003.1-2001 hosts.

2002-02-24  Paul Eggert  <eggert@twinsun.com>

        Port to POSIX 1003.1-2001 hosts.

        * doc/cvs.texinfo, src/sanity.sh: Don't use head -1.
        * FAQ: Don't use sort +0.1.
        * BUGS: Don't use diff -2.
        * contrib/cvs2vendor.sh, contrib/rcs2sccs.sh, contrib/sccs2rcs.in:
        Don't assume that sort +0 works.

===================================================================
RCS file: doc/cvs.texinfo,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- doc/cvs.texinfo     2001/04/24 18:14:52     1.11.1.1
+++ doc/cvs.texinfo     2002/02/24 08:14:54     1.11.1.1.0.1
@@ -11959,7 +11959,7 @@ evaluate the log message.
 #  Verify that the log message contains a valid bugid
 #  on the first line.
 #
-if head -1 < $1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
+if sed q < $1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
     exit 0
 else
     echo "No BugId found."
@@ -12077,7 +12077,7 @@ edit the log message.
 if [ "x$EDITOR" = "x" ]; then EDITOR=vi; fi
 if [ "x$CVSEDITOR" = "x" ]; then CVSEDITOR=$EDITOR; fi
 $CVSEDITOR $1
-until head -1|grep '^BugId:[ ]*[0-9][0-9]*$' < $1
+until sed q|grep '^BugId:[ ]*[0-9][0-9]*$' < $1
 do  echo -n  "No BugId found.  Edit again? ([y]/n)"
     read ans
     case $@{ans@} in
===================================================================
RCS file: FAQ,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- FAQ 2000/08/30 01:16:32     1.11.1.1
+++ FAQ 2002/02/24 08:14:54     1.11.1.1.0.1
@@ -4353,7 +4353,7 @@ kingdon@cyclic.com
    
    You should be able to run:
    
-   sort +0.1 ${dir1}/history ${dir2}/history > history
+   sort -k 1.2 ${dir1}/history ${dir2}/history > history
    
    If you "diff" a standard history file before and after such a sort,
    you might see other differences caused by garbage (split lines, nulls,
===================================================================
RCS file: BUGS,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- BUGS        1999/05/13 22:49:24     1.11.1.1
+++ BUGS        2002/02/24 08:14:54     1.11.1.1.0.1
@@ -101,7 +101,7 @@ file's description.
   Date: Sat, 25 Feb 1995 17:01:15 -0500
   
   mycroft@duality [1]; cd /usr/src/lib/libc
-  mycroft@duality [1]; cvs diff -c2 '-D1 day ago' -Dnow
+  mycroft@duality [1]; cvs diff -C2 '-D1 day ago' -Dnow
   cvs server: Diffing .
   cvs server: Diffing DB
   cvs [server aborted]: could not chdir to DB: No such file or directory
===================================================================
RCS file: src/sanity.sh,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- src/sanity.sh       2001/04/25 22:30:56     1.11.1.1
+++ src/sanity.sh       2002/02/24 08:14:54     1.11.1.1.0.1
@@ -14210,7 +14210,7 @@ ${PROG} [a-z]*: Rebuilding administrativ
          # Now test verifymsg
          cat >${TESTDIR}/vscript <<EOF
 #!${TESTSHELL}
-if head -1 < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
+if sed q < \$1 | grep '^BugId:[ ]*[0-9][0-9]*$' > /dev/null; then
     exit 0
 else
     echo "No BugId found."
@@ -18607,7 +18607,7 @@ done"
          dotest tag8k-16 "$testcvs -Q tag $t-a $file" ''
 
          # Extract the author value.
-         name=`sed -n 's/.*;   author \([^;]*\);.*/\1/p' 
${CVSROOT_DIRNAME}/$module/$file,v|head -1`
+         name=`sed -n 's/.*;   author \([^;]*\);.*/\1/p' 
${CVSROOT_DIRNAME}/$module/$file,v|sed q`
 
          # Form a suffix string of length (16 - length($name)).
          # CAREFUL: this will lose if $name is longer than 16.
===================================================================
RCS file: contrib/rcs2sccs.sh,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- contrib/rcs2sccs.sh 1997/02/12 15:35:07     1.11.1.1
+++ contrib/rcs2sccs.sh 2002/02/24 08:14:54     1.11.1.1.0.1
@@ -42,13 +42,17 @@ cp $tmpfile $sedfile
 ############################################################
 # Loop over every RCS file in RCS dir
 #
+if sort -k 1,1 /dev/null 2>/dev/null
+then sort_each_field='-k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9'
+else sort_each_field='+0 +1 +2 +3 +4 +5 +6 +7 +8'
+fi
 for vfile in *,v; do
     # get rid of the ",v" at the end of the name
     file=`echo $vfile | sed -e 's/,v$//'`
 
     # work on each rev of that file in ascending order
     firsttime=1
-    rlog $file | grep "^revision [0-9][0-9]*\." | awk '{print $2}' | sed -e 
's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
+    rlog $file | grep "^revision [0-9][0-9]*\." | awk '{print $2}' | sed -e 
's/\./ /g' | sort -n -u $sort_each_field | sed -e 's/ /./g' > $revfile
     for rev in `cat $revfile`; do
         if [ $? != 0 ]; then
                echo ERROR - revision
===================================================================
RCS file: contrib/cvs2vendor.sh,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- contrib/cvs2vendor.sh       1997/02/12 15:34:55     1.11.1.1
+++ contrib/cvs2vendor.sh       2002/02/24 08:14:54     1.11.1.1.0.1
@@ -42,6 +42,11 @@ rm -f $revfile
 commentfile=/tmp/cvs2vendor_$$_comment
 rm -f $commentfile
 
+if sort -k 1,1 /dev/null 2>/dev/null
+then sort_each_field='-k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9'
+else sort_each_field='+0 +1 +2 +3 +4 +5 +6 +7 +8'
+fi
+
 srcdirs=`cd $tsrcdir && find . -type d -print | sed 's~^\.[/]*~~'`
 
 # the "" is a trick to get $tsrcdir itself without resorting to '.'
@@ -68,7 +73,7 @@ for ldir in "" $srcdirs; do
                fi
 
                # work on each rev of that file in ascending order
-               rlog $file | grep "^revision [0-9][0-9]*\." | awk '{print $2}' 
| sed -e 's/\./ /g' | sort -n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' 
> $revfile
+               rlog $file | grep "^revision [0-9][0-9]*\." | awk '{print $2}' 
| sed -e 's/\./ /g' | sort -n -u $sort_each_field | sed -e 's/ /./g' > $revfile
 
                for rev in `cat $revfile`; do
 
===================================================================
RCS file: contrib/sccs2rcs.in,v
retrieving revision 1.11.1.1
retrieving revision 1.11.1.1.0.1
diff -pu -r1.11.1.1 -r1.11.1.1.0.1
--- contrib/sccs2rcs.in 2001/01/05 18:18:18     1.11.1.1
+++ contrib/sccs2rcs.in 2002/02/24 08:14:54     1.11.1.1.0.1
@@ -163,6 +163,13 @@ end
 
 onintr ERROR
 
+sort -k 1,1 /dev/null >& /dev/null
+if ($status == 0) then
+    set sort_each_field = '-k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9'
+else
+    set sort_each_field = '+0 +1 +2 +3 +4 +5 +6 +7 +8'
+endif
+
 ############################################################
 # Loop over every s-file in SCCS dir
 #
@@ -172,7 +179,7 @@ foreach sfile (SCCS/s.*)
 
     # work on each rev of that file in ascending order
     set firsttime = 1
-    sccs prs $file | grep "^D " | awk '{print $2}' | sed -e 's/\./ /g' | sort 
-n -u +0 +1 +2 +3 +4 +5 +6 +7 +8 | sed -e 's/ /./g' > $revfile
+    sccs prs $file | grep "^D " | awk '{print $2}' | sed -e 's/\./ /g' | sort 
-n -u $sort_each_field | sed -e 's/ /./g' > $revfile
     foreach rev (`cat $revfile`)
         if ($status != 0) goto ERROR
 



reply via email to

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