#!/usr/bin/perl # # add X-local-url tags to an rfc-tag file # # # - acts as a filter, i.e. takes a tag file in on stdin, and writes out to # stdout. # # this version expects to work on rfc-index.tag, and produces info into # rfc-report.html # # Where to find local copies of the rfcs $rfcdir="/usr2/local/rfc"; # The following will be prepended to every rfc file found $localurl="/rfc"; # where to find tag programs $tagbindir="/usr/local/bin"; open REPORT,">rfc-report.html" or die "Cant open rfc-report.html: $!\n"; open STDIN,"$rfcdir/rfc-index.tag" or die "Cant open $rfcdir/rfc-index.tag: $!\n"; open STDOUT,">$rfcdir/rfc-index.tag.new" or die "Cant open $rfcdir/rfc-index.tag.new $!\n"; while (<>) { print unless /^X-local-url/; if (/Url: (.*)/) { $file= substr( $1, rindex($1,"/")); print "X-local-url: ${localurl}${file}\n" if -e "${rfcdir}${file}"; } } # remove the old rfc-index.tag - assumes we bomb out if something goes wrong unlink "$rfcdir/rfc-index.tag"; rename "$rfcdir/rfc-index.tag.new","$rfcdir/rfc-index.tag"; $|=1; print REPORT "RFC local report\n"; print REPORT "

Locally held RFCs which are Obsoleted

\n"; system("/bin/cat $rfcdir/rfc-index.tag | $tagbindir/tagextract -m X-local-url -exists | $tagbindir/tagextract -m Obsoleted-by -exists | $tagbindir/tag2html >$rfcdir/rfc-report.html");