Plan 9 from Bell Labs’s /usr/web/sources/nix/nix/rc/bin/patch/okay

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


#!/bin/rc

rfork e
if(! ~ $#* 1){
	echo usage: patch/okay dir >[1=2]
	exit usage
}

i=$1
files=(files removed readme email)
for(f in $files)
	if(! test -e $i/$f ){
		echo  'missing file: '^$i/$f >[1=2]
		exit 'missing file: '^$i/$f
	}
if(grep -v '^/[_a-zA-Z0-9.\-+/:]+ [_a-zA-Z0-9.\-+:]+$' $i/files){
	echo $i: bad file list >[1=2]
	exit 'bad file list' 
}
if(grep -v '^/[_a-zA-Z0-9.\-+/:]+$' $i/removed){
	echo $i: bad removed list >[1=2]
	exit 'bad removed list' 
}
exit ''

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.