Plan 9 from Bell Labs’s /usr/web/sources/extra/changes/2006/0213

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Typo.
 [rsc] --rw-rw-r-- M 913078 glenda sys 4191 Feb 13 08:51 sys/man/2/exec
	/n/sourcesdump/2006/0213/plan9/sys/man/2/exec:1,6 - 
	/n/sourcesdump/2006/0214/plan9/sys/man/2/exec:1,6
	  .TH EXEC 2
	  .SH NAME
	- exec, execl, _privates, _nprivates, _tps \- execute a file
	+ exec, execl, _privates, _nprivates, _tos \- execute a file
	  .SH SYNOPSIS
	  .B #include <u.h>
	  .br

Missing SH
 [rsc] --rw-rw-r-- M 913078 rsc sys 1712 Feb 13 09:00 sys/man/8/getflags
	/n/sourcesdump/2006/0213/plan9/sys/man/8/getflags:1,4 - 
	/n/sourcesdump/2006/0214/plan9/sys/man/8/getflags:1,5
	  .TH GETFLAGS 8
	+ .SH NAME
	  getflags, usage \- command-line parsing for shell scripts
	  .SH SYNOPSIS
	  .B aux/getflags $*
	/n/sourcesdump/2006/0213/plan9/sys/man/8/getflags:65,71 - 
	/n/sourcesdump/2006/0214/plan9/sys/man/8/getflags:66,72
	  .EE
	  .SH SOURCE
	  .B /sys/src/cmd/aux/getflags.c
	- .PP
	+ .br
	  .B /sys/src/cmd/aux/usage.c
	  .SH SEE ALSO
	  .IR arg (2)

Install printarena.
 [rsc] --rwxrwxr-x M 913078 rsc sys 550 Feb 13 09:00 sys/src/cmd/venti/dumpvacroots
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/venti/dumpvacroots:4,14 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/venti/dumpvacroots:4,15
	  # if nothing else, this illustrates that you have to control access
	  # to the physical disks storing the archive!
	  
	- ventihttp=your-server:8000
	+ ventihttp=`{echo $venti | sed 's/^[a-z]+!([0-9\.]+)![a-z0-9]+$/\1/; s/^[a-z]+!([0-9\.]+)/\1/; s/$/:8000/'}
	+ 
	  hget http://$ventihttp/index | 
	  awk '
	   /^index=/ { blockSize=0+substr($3, 11); }
	   /^arena=/ { arena=substr($1, 7); }
	-  /^	arena=/ { start=0+substr($5, 2)-blockSize; printf("./8.printarena -o %d %s\n", start, $3); }' |
	+  /^	arena=/ { start=0+substr($5, 2)-blockSize; printf("venti/printarena -o %d %s\n", start, $3); }' |
	  rc |
	  sed -n 's/^(.*) 1$/vac:\1/p'
 [rsc] --rw-rw-r-- M 913078 glenda sys 1795 Feb 13 09:00 sys/src/cmd/venti/mkfile
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/venti/mkfile:63,68 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/venti/mkfile:63,69
	  	write\
	  	copy\
	  	conf\
	+ 	printarena\
	  #	dumparena\
	  
	  CFILES=${TARG:%=%.c} $LIBCFILES

Enough for autoconf.
 [rsc] --rw-rw-r-- M 913078 rsc sys 60 Feb 13 09:35 rc/bin/ape/printf
 [rsc] --rw-rw-r-- M 913078 rsc sys 60 Feb 13 09:35 rc/bin/ape/printf

Better comments.
 [rsc] --rwxrwxr-x M 913078 glenda sys 5140 Feb 13 09:03 rc/bin/lp
	/n/sourcesdump/2006/0213/plan9/rc/bin/lp:1,6 - 
	/n/sourcesdump/2006/0214/plan9/rc/bin/lp:1,7
	  #!/bin/rc
	- # This program enqueues the file to be printed and starts the daemon, when necessary.
	- # Make changes to /sys/src/cmd/lp/lp.rc.  Changes made directly to /rc/bin/lp will be lost.
	+ # lp - enqueues the file to be printed and starts the daemon, when necessary.
	+ # Make changes to /sys/src/cmd/lp/lp.rc;
	+ # changes made directly to /rc/bin/lp will be lost.
	  
	  rfork en	# so that environment and name space are not polluted
	  # 
	/n/sourcesdump/2006/0213/plan9/rc/bin/lp:138,143 - 
	/n/sourcesdump/2006/0214/plan9/rc/bin/lp:139,146
	  	LPLOC=`{echo $LPDEST|sed 's/^(.*)\/(.*)/\1/'}
	  	LPDEST=`{echo $LPDEST|sed 's/^(.*)\/(.*)/\2/'}
	  }
	+ 
	+ # look up device, get info
	  LPDLINE=`{grep '^'$LPDEST'[ 	]' $LPLIB/devices}
	  if (! ~ $status '') {
	  	echo 'device '$LPDEST' is not in '$LPLIB'/devices' >[1=2]
 [rsc] --rwxrwxr-x M 913078 glenda sys 5140 Feb 13 09:03 sys/src/cmd/lp/lp.rc
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/lp/lp.rc:1,6 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/lp/lp.rc:1,7
	  #!/bin/rc
	- # This program enqueues the file to be printed and starts the daemon, when necessary.
	- # Make changes to /sys/src/cmd/lp/lp.rc.  Changes made directly to /rc/bin/lp will be lost.
	+ # lp - enqueues the file to be printed and starts the daemon, when necessary.
	+ # Make changes to /sys/src/cmd/lp/lp.rc;
	+ # changes made directly to /rc/bin/lp will be lost.
	  
	  rfork en	# so that environment and name space are not polluted
	  # 
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/lp/lp.rc:138,143 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/lp/lp.rc:139,146
	  	LPLOC=`{echo $LPDEST|sed 's/^(.*)\/(.*)/\1/'}
	  	LPDEST=`{echo $LPDEST|sed 's/^(.*)\/(.*)/\2/'}
	  }
	+ 
	+ # look up device, get info
	  LPDLINE=`{grep '^'$LPDEST'[ 	]' $LPLIB/devices}
	  if (! ~ $status '') {
	  	echo 'device '$LPDEST' is not in '$LPLIB'/devices' >[1=2]

Ls in Unix's clothing.
 [rsc] --rwxrwxr-x M 913078 rsc sys 1018 Feb 13 09:35 rc/bin/ape/ls

More consistent output.
 [rsc] --rw-rw-r-- M 913078 glenda sys 5706 Feb 13 12:51 sys/src/cmd/ls.c
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/ls.c:36,41 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/ls.c:36,42
	  void	dowidths(Dir*);
	  void	format(Dir*, char*);
	  void	output(void);
	+ char*	xcleanname(char*);
	  ulong	clk;
	  int	swidth;			/* max width of -s size */
	  int	qwidth;			/* max width of -q version */
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/ls.c:106,112 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/ls.c:107,113
	  		n = dirreadall(fd, &db);
	  		if(n < 0)
	  			goto error;
	- 		cleanname(s);
	+ 		xcleanname(s);
	  		growto(ndir+n);
	  		for(i=0; i<n; i++){
	  			dirbuf[ndir+i].d = db+i;
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/ls.c:119,125 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/ls.c:120,126
	  		growto(ndir+1);
	  		dirbuf[ndir].d = db;
	  		dirbuf[ndir].prefix = 0;
	- 		cleanname(s);
	+ 		xcleanname(s);
	  		p = utfrrune(s, '/');
	  		if(p){
	  			dirbuf[ndir].prefix = s;
	/n/sourcesdump/2006/0213/plan9/sys/src/cmd/ls.c:304,306 - 
	/n/sourcesdump/2006/0214/plan9/sys/src/cmd/ls.c:305,324
	  	return buf;
	  }
	  
	+ /*
	+  * Compress slashes, remove trailing slash.  Don't worry about . and ..
	+  */
	+ char*
	+ xcleanname(char *name)
	+ {
	+ 	char *r, *w;
	+ 	
	+ 	for(r=w=name; *r; r++){
	+ 		if(*r=='/' && r>name && *(r-1)=='/')
	+ 			continue;
	+ 		*w++ = *r;
	+ 	}
	+ 	while(w-1>name && *(w-1)=='/')
	+ 		*--w = 0;
	+ 	return name;
	+ }
 [rsc] --rw-rw-r-- M 913078 glenda sys 5706 Feb 13 12:51 sys/src/cmd/ls.c


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].