| 1 |
#!/usr/bin/perl -T
|
| 2 |
|
| 3 |
use strict;
|
| 4 |
use warnings;
|
| 5 |
|
| 6 |
use DBI;
|
| 7 |
use CGI;
|
| 8 |
|
| 9 |
my $dbh = DBI->connect("dbi:Pg:dbname=udd") or die $!;
|
| 10 |
my $sth = $dbh->prepare(<<EOF
|
| 11 |
SELECT DISTINCT unstable.package, insts
|
| 12 |
FROM (SELECT DISTINCT package FROM packages
|
| 13 |
WHERE distribution = 'debian' and release = 'sid')
|
| 14 |
AS unstable,
|
| 15 |
popcon
|
| 16 |
WHERE NOT EXISTS (SELECT * FROM packages where distribution = 'debian'
|
| 17 |
AND release = 'lenny' and package = unstable.package)
|
| 18 |
AND popcon.package = unstable.package AND popcon.distribution = 'debian' ORDER BY insts DESC;
|
| 19 |
EOF
|
| 20 |
);
|
| 21 |
|
| 22 |
$sth->execute() or die $!;
|
| 23 |
|
| 24 |
my $q = CGI->new();
|
| 25 |
|
| 26 |
print $q->header(-type => 'text/plain');
|
| 27 |
while(my @row = $sth->fetchrow_array) {
|
| 28 |
my ($package, $score) = @row;
|
| 29 |
print "$package\t$score\n";
|
| 30 |
}
|
| 31 |
|