1234567891011121314151617181920212223242526272829 |
- #!/bin/rc
- if(! ~ $#* 1){
- echo 'usage: patch/diff patch-name' >[1=2]
- exit usage
- }
- if(! test -d /n/sources/patch){
- rfork n
- 9fs sources
- }
- if(! test -d /n/sources/patch/$1){
- echo 'no such patch' /n/sources/patch/$1 >[1=2]
- exit nopatch
- }
- cd /n/sources/patch/$1 || exit nopatch
- if(! patch/okay .){
- echo 'bad patch: '$status >[1=2]
- exit badpatch
- }
- d=/n/sources/patch/$1
- fn xxx {
- echo $1
- diff -n $2.orig $d/$2 | sed 's/^/ /'
- }
- cat files | sed 's/^/xxx /' |rc
|