note 670 B

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/rc
  2. rfork e
  3. if(! ~ $#* 1){
  4. echo 'usage: patch/note 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. builtin cd /n/sources/patch/$1 || exit nopatch
  16. if(! patch/okay .){
  17. echo 'bad patch: '$status >[1=2]
  18. exit badpatch
  19. }
  20. if(~ `{cat /proc/$pid/fd | awk 'NR==2{print $NF}'} */dev/cons && ~ `{ls -l /dev/consctl | awk '{print $1}'} *w*){
  21. >/dev/consctl {
  22. echo holdon
  23. {echo `{date} `{cat /dev/user}
  24. cat |sed 's/^/ /'; echo } >>notes
  25. }
  26. }
  27. if not
  28. {echo `{date} `{cat /dev/user}
  29. cat |sed 's/^/ /'; echo } >>notes