3 # Copyright (C) 2010 Alexander Wirt <formorer@debian.org>
5 # This program is free software; you can redistribute it and/or modify it under
6 # the terms of the GNU General Public License as published by the Free Software
7 # Foundation; either version 2 of the License, or (at your option) any later
10 # This program is distributed in the hope that it will be useful, but WITHOUT ANY
11 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12 # PARTICULAR PURPOSE. See the GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License along with
15 # this program; if not, see <http://www.gnu.org/licenses/>.
24 print "Output Filename needed\n";
28 my $dbh = DBI->connect("DBI:Pg:dbname=backports");
31 my $sth = $dbh->prepare( "
32 SELECT maintainer.name,
35 FROM source,source_suite,
37 WHERE source.id = source_suite.src
38 AND source.changedby = maintainer.id
39 AND ( suite_name = 'lenny-backports' or suite_name = 'squeeze-backports' )
40 GROUP BY source.source,maintainer.name;
43 if ( !defined $sth ) {
44 die "Cannot prepare statement: $DBI::errstr\n";
47 $sth->execute or die "Could not execute query: $DBI::errstr\n";
49 open (my $fh, '>', $outfile) or die "Could not open File $outfile for writing: $!";
51 while (my $row = $sth->fetchrow_hashref) {
53 if ($row->{'name'} =~ /<([^>]+)>/) {
58 printf($fh "%s: %s\n", $row->{'source'}, $email);