diff 474 B

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