]> git.decadent.org.uk Git - dak.git/blob - web/crypto-in-main/construct-archive-notification.pl
import latest bpo changes before merging its code around
[dak.git] / web / crypto-in-main / construct-archive-notification.pl
1 #!/usr/bin/perl -w
2
3 # Usage: construct-notification packages_files
4
5
6 use vars qw (%sources);
7
8
9
10 $/ = "";
11 while (<>) {
12   my @f = split(/^([a-z0-9]+):\s*/mi);
13   shift @f;
14   my %f = ();
15   while (@f) {
16     my $value = pop @f;
17     my $field = pop @f;
18     chomp $value;
19     $f{lc $field} = $value;
20   }
21   $f{source} = $f{package} unless defined $f{source};
22   $sources{$f{source}}{$f{package}} = $f{description};
23 }
24
25 foreach my $source (sort {$a cmp $b} keys %sources) {
26   print "Source package: $source\n";
27   foreach my $package (sort {$a cmp $b } keys %{$sources{$source}}) {
28     print "Package: $package\n";
29     print "Description: ";
30     print $sources{$source}{$package};
31     print "\n";
32   }
33   print "\n\n\n";
34 }