#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/cmd/auth/wrkey.c /n/dump/1995/0803/sys/src/cmd/auth/wrkey.c # srcdir: /n/juke/plan_9/sys/src/cmd/auth # version: 811712789 # date: Thu Sep 21 15:46:29 EDT 1995 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 811712789 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/sys/src/cmd/auth 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 811712789 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 811712789 mkdir 811712789 target=811712789/wrkey.c echo -n '811712789/wrkey.c: ' if(! test -f $srcdir/wrkey.c || ! test -r $srcdir/wrkey.c){ echo $srcdir/wrkey.c unreadable exit unreadable } sum=`{sum < $srcdir/wrkey.c} if(! ~ dbfd217e2029 $sum(1)^$sum(2)){ echo $srcdir/wrkey.c is not the original distribution file exit original } cp $srcdir/wrkey.c 811712789/wrkey.c ed 811712789/wrkey.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM wrkey.c' 65c if(seek(fd, safeoff, 0) < 0 . 45c || seek(fd, safeoff, 0) < 0 . 43c p = getenv("cputype"); if(p == 0) p = "mips"; if(strcmp(p, "sparc") == 0){ fd = open("#r/nvram", ORDWR); safeoff = 1024+850; } else if(strcmp(p, "386") == 0){ fd = open("#H/hd0nvram", ORDWR); if(fd < 0) fd = open("#w/sd0nvram", ORDWR); safeoff = 0x0; } else { fd = open("#r/nvram", ORDWR); safeoff = 1024+900; } . 40c int fd, safeoff; char *p; . wq //GO.SYSIN DD VADIM wrkey.c sum=`{sum < 811712789/wrkey.c} if(~ 79a80e032352 $sum(1)^$sum(2)) echo if not{ echo 811712789/wrkey.c checksum error creating updated file exit checksum }