#!/bin/rc # # command: /bin/boddle /usr/forsyth/cd/9660srv /sys/src/cmd/9660srv # srcdir: /usr/forsyth/cd/9660srv # version: 858458565 # date: Sat Mar 15 20:42:45 GMT 1997 # myname=$0 doextract=no fn usage{ echo $myname: usage: $myname '[-X] [src-directory]' >[1=2] exit usage } fn sigint{ rm -rf 858458565 exit interrupt } while(~ $1 -*){ switch($1){ case -X doextract=yes case -* usage } shift } switch($#*){ case 0 srcdir=/usr/forsyth/cd/9660srv 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 858458565 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 858458565 mkdir 858458565 target=858458565/9660srv.c echo -n '858458565/9660srv.c: ' if(! test -f $srcdir/9660srv.c || ! test -r $srcdir/9660srv.c){ echo $srcdir/9660srv.c unreadable exit unreadable } sum=`{sum < $srcdir/9660srv.c} if(! ~ 38b0920511270 $sum(1)^$sum(2)){ echo $srcdir/9660srv.c is not the original distribution file exit original } cp $srcdir/9660srv.c 858458565/9660srv.c ed 858458565/9660srv.c >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM 9660srv.c' 500a } static int getcontin(Xdata *dev, uchar *p, uchar **s) { long bn, off, len; Iobuf *b; bn = l32(p+4); off = l32(p+12); len = l32(p+20); chat("getcontin %d...", bn); b = getbuf(dev, bn); if(waserror()){ putbuf(b); *s = 0; return 0; } if(b == 0){ *s = 0; return 0; } *s = b->iobuf+off; putbuf(b); return len; . 491a if(fs->issusp){ nl = 0; s += fs->suspoff; sysl -= fs->suspoff; for(; sysl >= 4 && have != 3; sysl -= l, s += l){ l = s[2]; if(s[0] == 'P' && s[1] == 'X' && s[3] == 1){ /* posix file attributes */ mode = l32(s+4); d->mode = mode & 0777; if((mode & 0170000) == 040000){ d->mode |= CHDIR; d->qid.path |= CHDIR; } have |= 2; } else if(s[0] == 'N' && s[1] == 'M' && s[3] == 1){ /* alternative name */ if((s[4] & ~1) == 0){ i = nl+l-5; if(i >= NAMELEN) i = NAMELEN-1; if((i -= nl) > 0){ memmove(d->name+nl, s+5, i); nl += i; } if(s[4] == 0) have |= 1; } } else if(s[0] == 'C' && s[1] == 'E' && s[2] >= 28){ sysl = getcontin(fs->d, s, &s); continue; } else if(s[0] == 'S' && s[1] == 'T') break; } } . 474c if(fs->isrock) strcpy(d->gid, "ridge"); else strcpy(d->gid, "iso"); . 442,444d 436,437c sysl = dp->reclen-(34+dp->namelen); s = (uchar*)dp->name + dp->namelen; if(((ulong)s) & 1){ s++; sysl--; } if(fs->isplan9 && sysl > 0) { . 427a have = 1; . 413a have = 0; . 409c int n, flags, i, nl, vers, sysl, mode, l, have; . 407c rzdir(Xfs *fs, Dir *d, int fmt, Drec *dp) . 278c rzdir(f->xf, d, ip->fmt, &ip->d); . 210c rzdir(f->xf, &d, ip->fmt, drec); . 157c dvers = rzdir(f->xf, &dir, 'z', d); . 89a if(getdrec(root, rd) >= 0){ n = rd->reclen-(34+rd->namelen); s = (uchar*)rd->name + rd->namelen; if((ulong)s & 1){ s++; n--; } if(n >= 7 && s[0] == 'S' && s[1] == 'P' && s[2] == 7 && s[3] == 1 && s[4] == 0xBE && s[5] == 0xEF){ root->xf->issusp = 1; root->xf->suspoff = s[6]; n -= root->xf->suspoff; s += root->xf->suspoff; for(; n >= 4; s += l, n -= l){ l = s[2]; if(s[0] == 'E' && s[1] == 'R'){ if(s[4] == 10 && memcmp(s+8, "RRIP_1991A", 10) == 0) root->xf->isrock = 1; break; } else if(s[0] == 'C' && s[1] == 'E' && s[2] >= 28){ n = getcontin(root->xf->d, s, &s); continue; } else if(s[0] == 'R' && s[1] == 'R'){ root->xf->isrock = 1; break; } else if(s[0] == 'S' && s[1] == 'T') break; } } } if(root->xf->isrock) chat("Rock Ridge..."); fp->offset = 0; fp->doffset = 0; . 50c int fmt, blksize, n, l; uchar dbuf[256]; Drec *rd = (Drec *)dbuf; uchar *s; . 33c static int rzdir(Xfs*, Dir*, int, Drec*); . 25a static int getcontin(Xdata*, uchar*, uchar**); . wq //GO.SYSIN DD VADIM 9660srv.c sum=`{sum < 858458565/9660srv.c} if(~ cfa3d10f13558 $sum(1)^$sum(2)) echo if not{ echo 858458565/9660srv.c checksum error creating updated file exit checksum } target=858458565/dat.h echo -n '858458565/dat.h: ' if(! test -f $srcdir/dat.h || ! test -r $srcdir/dat.h){ echo $srcdir/dat.h unreadable exit unreadable } sum=`{sum < $srcdir/dat.h} if(! ~ e75b08b21688 $sum(1)^$sum(2)){ echo $srcdir/dat.h is not the original distribution file exit original } cp $srcdir/dat.h 858458565/dat.h ed 858458565/dat.h >/dev/null >[2=1] <<'//GO.SYSIN DD VADIM dat.h' 56a int issusp; /* follows system use sharing protocol */ int suspoff; /* if so, offset at which SUSP area begins */ int isrock; /* Rock Ridge format */ . wq //GO.SYSIN DD VADIM dat.h sum=`{sum < 858458565/dat.h} if(~ 80cee27f1840 $sum(1)^$sum(2)) echo if not{ echo 858458565/dat.h checksum error creating updated file exit checksum }