1234567891011121314151617181920212223242526272829 |
- #!/bin/rc
- rfork e
- if(~ $#* 0 1){
- echo 'usage: patch/move dst patch-name...' >[1=2]
- exit usage
- }
- if(! test -d /n/sources/patch){
- rfork n
- 9fs sources
- }
- dst=$1
- shift
- for(i){
- j=`{basename $i}
- if(! test -d /n/sources/patch/$i)
- echo 'no such patch' /n/sources/patch/$i >[1=2]
- if not if(test -d /n/sources/patch/$dst/$j)
- echo 'already have' /n/sources/patch/$dst/$j >[1=2]
- if not
- ls -ldp /n/sources/patch/$i >/n/sources/patch/$i/origls &&
- mkdir /n/sources/patch/$dst/$j &&
- dircp /n/sources/patch/$i /n/sources/patch/$dst/$j &&
- rm -rf /n/sources/patch/$i &&
- test -s /n/sources/patch/$dst/$j/email &&
- patch/notify $dst/$j
- }
|