#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/cmd/import.c /n/dump/1995/0718/sys/src/cmd/import.c # srcdir: /n/juke/plan_9/sys/src/cmd # version: 811707728 # date: Thu Sep 21 14:22:08 EDT 1995 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 811707728 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 811707728 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 811707728 mkdir 811707728 target=811707728/import.c echo -n '811707728/import.c: ' if(! test -f $srcdir/import.c || ! test -r $srcdir/import.c){ echo $srcdir/import.c unreadable exit unreadable } sum=`{sum < $srcdir/import.c} if(! ~ 26adc6641563 $sum(1)^$sum(2)){ echo $srcdir/import.c is not the original distribution file exit original } cp $srcdir/import.c 811707728/import.c ed 811707728/import.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM import.c' 94c print("Usage: import [-abc] host remotefs [mountpoint]\n"); . 84,87c fprint(2, "import: %s\n", msg); . 79c error(char *fmt, ...) . 73c error("bad remote tree: %s\n", buf); . 66c error("can't write tree: %r"); . 62c error("%r: %s", system); . 59c error("can't dial %s: %r", system); . 50a void catcher(void*, char *msg) { if(strcmp(msg, "alarm") == 0) noted(NCONT); noted(NDFLT); } . 46c error("can't mount %s: %r", argv[1]); . 42a notify(catcher); . 7c void catcher(void*, char*); void error(char*, ...); . wq //GO.SYSIN DD VADIM import.c sum=`{sum < 811707728/import.c} if(~ 477d8ad21611 $sum(1)^$sum(2)) echo if not{ echo 811707728/import.c checksum error creating updated file exit checksum }