default: @echo 'Try one of {rebuild}' rebuild: rebuild_rsync rebuild_reformat rebuild_convert rebuild_compress rebuild_rsync: rsync -avz --exclude=/.mailbox --delete ftp.rfc-editor.org::rfcs-text-only rfc/rfctxt/ chmod 644 rfc/rfctxt/rfc*txt rebuild_reformat: cd rfc/rfctxt; for i in rfc*.txt; do perl -e ' \ exit(0) if(-f "../rfcfmt/'$$i'" && "'$$i'" !~ /^rfc-index/); \ print "Reformatting '$$i'\n"; \ $$output = ""; $$buffer = ""; \ while($$line = ) { \ $$line =~ tr/\000-\037//d; \ $$line .= "\n"; \ $$t = $$line; \ $$t =~ tr/A-Za-z//cd; \ if(length($$line) >= 2 * length($$t)) { \ $$output .= "$$buffer\n$$line"; \ $$buffer = ""; \ } else { $$buffer .= $$line; } \ $$buffer =~ s/\s+/ /gs; \ } \ $$output .= $$buffer; \ $$output =~ s/\n\n+/\n\n/gs; \ open(FILE, ">../rfcfmt/'$$i'"); \ print FILE $$output; \ close(FILE); \ ' < $$i; done rebuild_convert: grep -h ^[[:digit:]][[:digit:]][[:digit:]][[:digit:]] rfc/rfcfmt/rfc-index*|perl -e ' \ while (<>) { \ s/\s+/ /g; \ /^(0*(\d+).*)$$/; \ next unless(-f "rfc/rfcfmt/rfc$$2.txt"); \ if(!-f "rfc/pdb/rfc$$2.pdb.bz2" || -M "rfc/pdb/rfc$$2.pdb.bz2" > -M "rfc/rfcfmt/rfc$$2.txt") { \ print "Converting RFC $$2\n"; \ @foo = ("txt2pdbdoc", "RFC-$$1", "rfc/rfcfmt/rfc$$2.txt", "rfc/pdb/rfc$$2.pdb"); \ system(@foo) && print "FAIL:\n $$_\n ".join("\n ",@foo)."\n"; \ } \ } \ ' rebuild_compress: find rfc/pdb -name \*.pdb -exec bzip2 -9 {} \;