3 ## $Id: munge-data 5144 2002-02-24 06:24:55Z rra $
5 ## Munge .overview data into something suitable for test data.
7 ## This script isn't used regularly and is here only for the use of INN
8 ## developers and other people needing to generate more overview test data.
9 ## It expects overview data but possibly with extra fields at the end, snips
10 ## off To: data (to avoid putting people's e-mail addresses into INN test
11 ## data), and if Newsgroups: data is present, rewrites the Xref header to use
12 ## it instead of keeping the Xref data (this is so that I can use .overview
13 ## files from Gnus as test data). It generates overview data but with the
14 ## newsgroup name and a colon prepended to the article number so that it can
15 ## be split apart into overview data for multiple groups.
17 ## Please don't include overview information for people's articles into INN's
18 ## test suite without their permission.
23 my @data = split /\t/;
24 @data = grep { !/^To:/ } @data;
25 my $group = pop @data;
27 if ($group =~ s/^Newsgroups: //) {
28 my @groups = split (/\s*,\s*/, $group);
30 $number{$_} = 1 unless $number{$_};
31 $data[0] = $_ . ':' . $number{$_}++;
32 $number{$_} += int (rand 5) if rand (10) > 8;
33 print join ("\t", @data, "Xref: inn.example.com $data[0]"), "\n";
36 $xref =~ s/Xref:\s*\S+\s+//;
37 my @xref = split (' ', $xref);
40 print join ("\t", @data, "Xref: inn.example.com $xref"), "\n";