diff 466 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/rc
  2. if(! ~ $#* 1){
  3. echo 'usage: patch/diff patch-name' >[1=2]
  4. exit usage
  5. }
  6. if(! test -d /n/sources/patch){
  7. rfork n
  8. 9fs sources
  9. }
  10. if(! test -d /n/sources/patch/$1){
  11. echo 'no such patch' /n/sources/patch/$1 >[1=2]
  12. exit nopatch
  13. }
  14. cd /n/sources/patch/$1 || exit nopatch
  15. if(! patch/okay .){
  16. echo 'bad patch: '$status >[1=2]
  17. exit badpatch
  18. }
  19. d=/n/sources/patch/$1
  20. fn xxx {
  21. echo $1
  22. diff -n $2.orig $d/$2 | sed 's/^/ /'
  23. }
  24. cat files | sed 's/^/xxx /' |rc