]> git.lizzy.rs Git - plan9front.git/blob - lib/rfc/grabrfc
Import sources from 2011-03-30 iso image - lib
[plan9front.git] / lib / rfc / grabrfc
1 #!/bin/rc
2 # grabrfc - copy new rfcs and drafts into /lib/rfc
3 rfork en
4 path=(/bin)
5 fn cd
6 dom=`{ndb/query sys $sysname dom}
7
8 ramfs
9 ftpfs -q/ -a $user@$dom ftp.rfc-editor.org      # was ftp.isi.edu
10
11 found=no
12 LIB=/lib/rfc
13 cd /n/ftp/in-notes
14 for(i in rfc*){
15         target=`{
16                 echo $i | sed '
17                         s/.txt$//
18                         s/rfc0*/rfc/'
19         }
20         if(test ! -e $LIB/$target && test -f $i){
21                 cp $i $LIB/$target
22                 chmod 664 $LIB/$target
23                 found=yes
24                 echo $target
25         }
26 }
27 if (~ $found yes)
28         tr A-Z a-z <rfc-index.txt | sed 's/^0*//' |
29                 sed 's/^[0-9]/rfc&/' >$LIB/index
30 unmount /n/ftp
31
32 ftpfs -q/ -a $user@$dom ftp.ietf.org
33
34 # copy in new ones
35 found=no
36 LIB=/lib/rfc/drafts
37 cd /n/ftp/internet-drafts
38 for(i in *){
39         target=$i
40         if (test ! -e $LIB/$target && test -f $i &&
41             test `{ls -s $i | sed 's/ .*//'} -ge 2){
42                 cp $i $LIB/$target
43                 chmod 664 $LIB/$target
44                 echo drafts/$i
45         }
46 }