X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=cgi%2Fpkgreport.cgi;h=d27caa13dc39c58dd5dc0a7216d1086fd39c32a1;hb=6bbfa69e364cefa3ff11ddd5646bfefe6b485071;hp=a0d7685d73f28ba72220d68254b98b657d094ed5;hpb=dfe9e7343c6b6e24b9413a65f3f7218c9872d8bf;p=debbugs.git diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index a0d7685..d27caa1 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -20,7 +20,7 @@ BEGIN{ binmode(STDOUT,':encoding(UTF-8)'); use POSIX qw(strftime nice); -use List::Util qw(uniq); +use List::AllUtils qw(uniq); use Debbugs::Config qw(:globals :text :config); @@ -39,6 +39,14 @@ use Debbugs::CGI::Pkgreport qw(:all); use Debbugs::Text qw(:templates); +use Debbugs::DB; + +my $s; +if (defined $config{database}) { + $s = Debbugs::DB->connect($config{database}) or + die "Unable to connect to DB"; +} + use CGI::Simple; my $q = new CGI::Simple; @@ -379,6 +387,7 @@ my $title = $gBugs.' '.join(' and ', map {/ or /?"($_)":$_} @title); grep {$_ ne 'newest'} keys %package_search_keys, 'archive'), usertags => \%ut, + defined $s?(schema => $s):(), ); # shove in bugs which affect this package if there is a package or a @@ -392,6 +401,7 @@ if (not exists $param{affects} and not exists $param{noaffects} and grep {$_ ne 'newest'} keys %package_search_keys, 'archive'), usertags => \%ut, + defined $s?(schema => $s):(), ); } @@ -436,6 +446,7 @@ my $result = pkg_htmlizebugs(bugs => \@bugs, exclude => $exclude, this => $this, options => \%param, + defined $s?(schema => $s):(), (exists $param{dist})?(dist => $param{dist}):(), );