list 749 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #!/bin/rc
  2. rfork e
  3. if(! test -d /n/sources/patch){
  4. rfork n
  5. 9fs sources
  6. }
  7. pref=''
  8. cd /n/sources/patch
  9. if(~ $1 saved sorry applied undecided){
  10. pref=$1^'/'
  11. shift
  12. }
  13. if(~ $#* 0)
  14. *=(`{if(~ $pref *?*) cd $pref; ls -t | grep -v '^(saved|sorry|applied|undecided)$'})
  15. trunc=(sed 5q)
  16. if(~ $#* 1)
  17. trunc=cat
  18. {
  19. for(i in $*){
  20. i=$pref^$i
  21. if(test -f $i/origls)
  22. cat $i/origls | awk '{$NF="'$i'"; print}'
  23. if not
  24. ls -ld $i
  25. if(patch/okay $i){
  26. if(test -r $i/email)
  27. echo from `{cat $i/email}
  28. cat $i/files | awk '{print " " $1}'
  29. cat $i/readme | sed 's/^/ /' | $trunc
  30. if(test -f $i/notes){
  31. echo
  32. cat $i/notes
  33. }
  34. }
  35. if not
  36. echo ' 'bad patch: $status >[2=1]
  37. echo
  38. }
  39. } >/tmp/patchtmp.$pid
  40. cat /tmp/patchtmp.$pid
  41. rm -f /tmp/patchtmp.$pid