#!/bin/rc # # command: /bin/boddle /n/juke/plan_9/sys/src/cmd/ktrans . # srcdir: /n/juke/plan_9/sys/src/cmd/ktrans # version: 812697303 # date: Tue Oct 3 01:15:03 EDT 1995 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 812697303 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/sys/src/cmd/ktrans 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 812697303 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 812697303 mkdir 812697303 target=812697303/translate.c echo -n '812697303/translate.c: ' if(! test -f $srcdir/translate.c || ! test -r $srcdir/translate.c){ echo $srcdir/translate.c unreadable exit unreadable } sum=`{sum < $srcdir/translate.c} if(! ~ c1303c873923 $sum(1)^$sum(2)){ echo $srcdir/translate.c is not the original distribution file exit original } cp $srcdir/translate.c 812697303/translate.c ed 812697303/translate.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM translate.c' 234,235c if (tflag==0) for (j=0; j=v+NKCHAR) return 0; . 214c char v[NKCHAR+UTFmax], *p, *ep; . 212a #define NKCHAR 1024 . 25,33c if (argc>1 && strcmp(argv[1], "-t")==0) { tflag = 1; in = 0; out = 1; } else { if ((in = open("/dev/kbd", OREAD)) < 0) exits("open /dev/kbd read"); if ((out = open("/dev/kbd", OWRITE)) < 0) exits("open /dev/kbd/write"); if (rfork(RFPROC)) exits(0); atnotify(noter, 1); } . 7a int tflag; . wq //GO.SYSIN DD VADIM translate.c sum=`{sum < 812697303/translate.c} if(~ 690235974085 $sum(1)^$sum(2)) echo if not{ echo 812697303/translate.c checksum error creating updated file exit checksum }