| 1 |
neronus-guest |
950 |
#!/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 |
neronus-guest |
966 |
SELECT DISTINCT unstable.package, insts |
| 12 |
neronus-guest |
950 |
FROM (SELECT DISTINCT package FROM sources |
| 13 |
|
|
WHERE distribution = 'debian' and release = 'sid') |
| 14 |
|
|
AS unstable, |
| 15 |
|
|
popcon_src_max |
| 16 |
|
|
WHERE NOT EXISTS (SELECT * FROM sources WHERE distribution = 'debian' |
| 17 |
|
|
AND release = 'lenny' and package = unstable.package) |
| 18 |
neronus-guest |
966 |
AND popcon_src_max.package = unstable.package AND popcon_src_max.distribution = 'debian' ORDER BY insts DESC; |
| 19 |
neronus-guest |
950 |
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 |
|
|
|