X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCGI%2FPkgreport.pm;h=6f29e9316263856f3ea5611dc857ae70b8381ba9;hb=6617fa4e20357b7c2bb9f5990984b08d4f827089;hp=d047affb1d262827d204552b3fc4c52ece4e9b63;hpb=8e1a4412aaae391ff8ef27ae90cd5fe53e685d19;p=debbugs.git diff --git a/Debbugs/CGI/Pkgreport.pm b/Debbugs/CGI/Pkgreport.pm index d047aff..6f29e93 100644 --- a/Debbugs/CGI/Pkgreport.pm +++ b/Debbugs/CGI/Pkgreport.pm @@ -28,7 +28,7 @@ None known. use warnings; use strict; use vars qw($VERSION $DEBUG %EXPORT_TAGS @EXPORT_OK @EXPORT); -use base qw(Exporter); +use Exporter qw(import); use IO::Scalar; use Params::Validate qw(validate_with :types); @@ -41,6 +41,7 @@ use Debbugs::Bugs qw(bug_filter); use Debbugs::Packages qw(:mapping); use Debbugs::Text qw(:templates); +use Encode qw(decode_utf8); use POSIX qw(strftime); @@ -107,7 +108,8 @@ sub generate_package_info{ } else { print {$output} "
There is no maintainer for $showpkg. ". - "Please do not report new bugs against this package.
\n"; + "This means that this package no longer exists (or never existed). ". + "Please do not report new bugs against this package. \n"; } my @pkgs = getsrcpkgs($srcforpkg); @pkgs = grep( !/^\Q$package\E$/, @pkgs ); @@ -126,25 +128,27 @@ sub generate_package_info{ my @references; my $pseudodesc = getpseudodesc(); if ($package and defined($pseudodesc) and exists($pseudodesc->{$package})) { - push @references, "to the ". + push @references, "to the ". "list of other pseudo-packages"; } elsif (not defined $maint and not @{$param{bugs}}) { - print {$output} "There is no record of the " . html_escape($package) . - ($param{binary} ? " package" : " source package") . - ", and no bugs have been filed against it.
"; + # don't bother printing out this information, because it's + # already present above. + # print {$output} "There is no record of the " . html_escape($package) . + # ($param{binary} ? " package" : " source package") . + # ", and no bugs have been filed against it.
"; } else { if ($package and defined $config{package_pages} and length $config{package_pages}) { push @references, sprintf "to the %s package page", - html_escape("http://$config{package_pages}/$package"), html_escape("$package"); + html_escape("$config{package_pages}/$package"), html_escape("$package"); } if (defined $config{subscription_domain} and length $config{subscription_domain}) { my $ptslink = $param{binary} ? $srcforpkg : $package; # the pts only wants the source, and doesn't care about src: (#566089) $ptslink =~ s/^src://; - push @references, q(to the Package Tracking System); + push @references, q(to the Package Tracking System); } # Only output this if the source listing is non-trivial. if ($param{binary} and $srcforpkg) { @@ -162,9 +166,9 @@ sub generate_package_info{ if (defined $maint) { print {$output} "If you find a bug not listed here, please\n"; printf {$output} "report it.
\n", - html_escape("http://$config{web_domain}/Reporting$config{html_suffix}"); + html_escape("$config{web_domain}/Reporting$config{html_suffix}"); } - return $output_scalar; + return decode_utf8($output_scalar); } @@ -221,7 +225,7 @@ sub short_bug_status_html { if (@blockedby && $status{"pending"} ne 'fixed' && ! length($status{done})) { for my $b (@blockedby) { my %s = %{get_bug_status($b)}; - next if $s{"pending"} eq 'fixed' || length $s{done}; + next if (defined $s{pending} and $s{pending} eq 'fixed') or (defined $s{done} and length $s{done}); push @{$status{blockedby_array}},{bug_num => $b, subject => $s{subject}, status => \%s}; } } @@ -346,12 +350,14 @@ sub pkg_htmlizebugs { push @{$exclude{$key}}, split /\s*,\s*/, $value; } + my $binary_to_source_cache = {}; foreach my $bug (@bugs) { my %status = %{get_bug_status(bug=>$bug, (exists $param{dist}?(dist => $param{dist}):()), bugusertags => $param{bugusertags}, (exists $param{version}?(version => $param{version}):()), (exists $param{arch}?(arch => $param{arch}):(arch => $config{default_architectures})), + binary_to_source_cache => $binary_to_source_cache, )}; next unless %status; next if bug_filter(bug => $bug, @@ -363,7 +369,6 @@ sub pkg_htmlizebugs { ); my $html = "