Index: frontends/pullnews.in =================================================================== RCS file: /proj/cvs/isc/inn/inn/frontends/pullnews.in,v retrieving revision 1.4 diff -u -r1.4 pullnews.in --- frontends/pullnews.in 2000/09/20 15:21:48 1.4 +++ frontends/pullnews.in 2003/06/28 00:09:44 @@ -80,7 +80,7 @@ my $defaultHost = "localhost"; $usage =~ s!.*/!!; -$usage .= " [ -h -q -r file -g groups -c config -s host -p port ] +$usage .= " [ -h -q -x -r file -g groups -c config -s host -p port ] -g groups specifies a collection of groups to get. The value must be a single argument with commas between group names: @@ -102,6 +102,8 @@ -r file instead of feeding to a server $0 will instead create an rnews-compatible file. + -x insert an Xref header in any article that lacks one. + -q $0 will normally be verbose about what it's doing. This option will make it quiet. @@ -109,8 +111,8 @@ "; -use vars qw($opt_q $opt_r $opt_s $opt_c $opt_g $opt_p $opt_h); -getopts("r:c:s:qg:p:h") || die $usage; +use vars qw($opt_q $opt_r $opt_x $opt_s $opt_c $opt_g $opt_p $opt_h); +getopts("r:c:s:qxg:p:h") || die $usage; die $usage if $opt_h; @@ -413,6 +415,7 @@ my $article = $fromServer->article($i) ; if ($article) { my $msgid ; + my $xref = 0; my $headers = 1; my $idx; @@ -421,6 +424,10 @@ $msgid = $1 ; } + if ($opt_x && $article->[$idx] =~ m!^xref:!i) { + $xref = 1; + } + # catch some of the more common problems with articles. if ($article->[$idx] =~ m!^\s+\n$!) { $article->[$idx] = "\n"; @@ -435,6 +442,13 @@ next ; } + # some old servers lack Xref: which bothers a downstream INN if + # it has xrefslave set, so add one just before the blank line. + if ($opt_x && !$xref) { + warn "No xref found in article, adding\n"; + splice(@{$article}, $idx, 0, "Xref: $server $group: $i\n"); + } + $pulled->{$server}->{$group}++; if ($rnews) {