1
0

move 585 B

12345678910111213141516171819202122232425262728
  1. #!/bin/rc
  2. # patch/move target patch-tree... - move patch tree(s) to target dir
  3. rfork e
  4. pats=/n/sources/patch
  5. if(~ $#* 0 1){
  6. echo 'usage: patch/move dst patch-name...' >[1=2]
  7. exit usage
  8. }
  9. if(! test -d $pats){
  10. rfork n
  11. 9fs sources
  12. }
  13. cd $pats
  14. dst=$1
  15. shift
  16. for(src){
  17. patdest=$dst/^`{basename $src}
  18. if(! test -d $src)
  19. echo 'no such patch' $pats/$src >[1=2]
  20. if not if(test -d $patdest)
  21. echo 'already have' $pats/$patdest >[1=2]
  22. if not
  23. ls -ldp $src >$src/origls &&
  24. mkdir $patdest && dircp $src $patdest && rm -rf $src &&
  25. test -s $patdest/email && patch/notify $patdest
  26. }