#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/cmd/test.c /sys/src/cmd/test.c # srcdir: /n/juke/plan_9/sys/src/cmd # version: 823716078 # date: Wed Feb 7 13:01:18 EST 1996 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 823716078 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/sys/src/cmd case 1 srcdir=$1 case * usage } if(! ~ $doextract yes){ echo This shell file contains a bundle of diffs representing changes echo to original source files in the Plan 9 distribution. It will run echo against the files in echo ' ' $srcdir echo '(unless overridden by the optional source directory argument)' echo and create a directory 823716078 containing the updated files. echo It will NOT automatically update the original files. echo echo Invoke with argument -X to perform the actual extraction. exit 0 } rm -rf 823716078 mkdir 823716078 target=823716078/test.c echo -n '823716078/test.c: ' if(! test -f $srcdir/test.c || ! test -r $srcdir/test.c){ echo $srcdir/test.c unreadable exit unreadable } sum=`{sum < $srcdir/test.c} if(! ~ 0e48b5e53432 $sum(1)^$sum(2)){ echo $srcdir/test.c is not the original distribution file exit original } cp $srcdir/test.c 823716078/test.c ed 823716078/test.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM test.c' 86c return(!e2()); . 78c if (EQ(nxtarg(1), "-a")) return (p1 && e1()); . 68c if (EQ(nxtarg(1), "-o")) return(p1 || e()); . wq //GO.SYSIN DD VADIM test.c sum=`{sum < 823716078/test.c} if(~ 458cab2b3434 $sum(1)^$sum(2)) echo if not{ echo 823716078/test.c checksum error creating updated file exit checksum }