#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/cmd/du.c /sys/src/cmd/du.c # srcdir: /n/juke/plan_9/sys/src/cmd # version: 838137641 # date: Tue Jul 23 12:00:41 EDT 1996 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 838137641 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 838137641 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 838137641 mkdir 838137641 target=838137641/du.c echo -n '838137641/du.c: ' if(! test -f $srcdir/du.c || ! test -r $srcdir/du.c){ echo $srcdir/du.c unreadable exit unreadable } sum=`{sum < $srcdir/du.c} if(! ~ 8239bfaf2308 $sum(1)^$sum(2)){ echo $srcdir/du.c is not the original distribution file exit original } cp $srcdir/du.c 838137641/du.c ed 838137641/du.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM du.c' 25,29c if(s) { blocksize = strtoul(s, &ss, 0); if(s == ss) blocksize = 1; if(*ss == 'k') blocksize *= 1024; } . 22c case 'a': aflag=1; break; . wq //GO.SYSIN DD VADIM du.c sum=`{sum < 838137641/du.c} if(~ 751a56802331 $sum(1)^$sum(2)) echo if not{ echo 838137641/du.c checksum error creating updated file exit checksum }