#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/cmd/tar.c /sys/src/cmd/tar.c # srcdir: /n/juke/plan_9/sys/src/cmd # version: 817699203 # date: Wed Nov 29 21:40:03 EST 1995 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 817699203 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 817699203 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 817699203 mkdir 817699203 target=817699203/tar.c echo -n '817699203/tar.c: ' if(! test -f $srcdir/tar.c || ! test -r $srcdir/tar.c){ echo $srcdir/tar.c unreadable exit unreadable } sum=`{sum < $srcdir/tar.c} if(! ~ 6b52f89912614 $sum(1)^$sum(2)){ echo $srcdir/tar.c is not the original distribution file exit original } cp $srcdir/tar.c 817699203/tar.c ed 817699203/tar.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM tar.c' 504c i += *cp & 0xff; . 472c fprint(2, "tar: mkdir %s failed: %r\n", name); close(f); . 470d 202a if(cd && chdir(cwd) < 0) { fprint(2, "tar: can't cd back to %s: %r\n", cwd); exits("cwd"); } . 200a cd = 1; . 192a cd = 0; . 189a cwd = *argv; . 175a if (getwd(cwdbuf, sizeof(cwdbuf)) == 0) { fprint(2, "tar: can't find current directory: %s\n", cwdbuf); exits("cwd"); } cwd = cwdbuf; . 174a int cd; . 173a char cwdbuf[2048], *cwd; . wq //GO.SYSIN DD VADIM tar.c sum=`{sum < 817699203/tar.c} if(~ 40c88e9c12942 $sum(1)^$sum(2)) echo if not{ echo 817699203/tar.c checksum error creating updated file exit checksum }