X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=Debbugs%2FCGI%2FPkgreport.pm;h=2d0de6f6c74803a704948c31e9fb7ba1961e34ce;hb=5be51c11e02e9b3ade84ff8306fdd8b5e89ab577;hp=06946a63a62a9ef0a74a0608b9ad2beba4b3096a;hpb=6f2cf73da85b74a1bd6a178e4dc5e2477e8c77bc;p=debbugs.git diff --git a/Debbugs/CGI/Pkgreport.pm b/Debbugs/CGI/Pkgreport.pm index 06946a6..2d0de6f 100644 --- a/Debbugs/CGI/Pkgreport.pm +++ b/Debbugs/CGI/Pkgreport.pm @@ -41,6 +41,7 @@ use Debbugs::Bugs qw(bug_filter); use Debbugs::Packages qw(:mapping); use Debbugs::Text qw(:templates); +use Encode qw(encode_utf8); use POSIX qw(strftime); @@ -51,13 +52,9 @@ BEGIN{ @EXPORT = (); %EXPORT_TAGS = (html => [qw(short_bug_status_html pkg_htmlizebugs), - qw(pkg_javascript), - qw(pkg_htmlselectyesno pkg_htmlselectsuite), - qw(buglinklist pkg_htmlselectarch) ], - misc => [qw(generate_package_info make_order_list), - qw(myurl), - qw(get_bug_order_index determine_ordering), + misc => [qw(generate_package_info), + qw(determine_ordering), ], ); @EXPORT_OK = (qw()); @@ -78,7 +75,7 @@ sub generate_package_info{ spec => {binary => {type => BOOLEAN, default => 1, }, - package => {type => SCALAR|ARRAYREF, + package => {type => SCALAR,#|ARRAYREF, }, options => {type => HASHREF, }, @@ -104,14 +101,15 @@ sub generate_package_info{ my $maint = $maintainers->{$srcforpkg}; if (defined $maint) { print {$output} '
'; - print {$output} htmlize_maintlinks(sub { $_[0] == 1 ? "Maintainer for $showpkg is " - : "Maintainers for $showpkg are " - }, - $maint); + print {$output} (($maint =~ /,/)? "Maintainer for $showpkg is " + : "Maintainers for $showpkg are ") . + package_links(maint => $maint); print {$output} ".
\n"; } else { - print {$output} "No maintainer for $showpkg. Please do not report new bugs against this package.
\n"; + print {$output} "There is no maintainer for $showpkg. ". + "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 ); @@ -130,17 +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}}) { + # 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 $gPackagePages) { + if ($package and defined $config{package_pages} and length $config{package_pages}) { push @references, sprintf "to the %s package page", - html_escape("http://${gPackagePages}/$package"), html_escape("$package"); + html_escape("http://$config{package_pages}/$package"), html_escape("$package"); } - if (defined $gSubscriptionDomain) { + if (defined $config{subscription_domain} and + length $config{subscription_domain}) { my $ptslink = $param{binary} ? $srcforpkg : $package; - push @references, q(to the Package Tracking System); + # the pts only wants the source, and doesn't care about src: (#566089) + $ptslink =~ s/^src://; + push @references, q(to the Package Tracking System); } # Only output this if the source listing is non-trivial. if ($param{binary} and $srcforpkg) { @@ -155,17 +163,12 @@ sub generate_package_info{ $references[$#references] = "or $references[$#references]" if @references > 1; print {$output} "You might like to refer ", join(", ", @references), ".
\n"; } - if (defined $param{maint} || defined $param{maintenc}) { + if (defined $maint) { print {$output} "If you find a bug not listed here, please\n"; printf {$output} "report it.
\n", - html_escape("http://${debbugs::gWebDomain}/Reporting${debbugs::gHTMLSuffix}"); - } - if (not $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.
"; + html_escape("http://$config{web_domain}/Reporting$config{html_suffix}"); } - return $output_scalar; + return encode_utf8($output_scalar); } @@ -222,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}; } } @@ -232,12 +235,15 @@ sub short_bug_status_html { if (@blocks && $status{"pending"} ne 'fixed' && ! length($status{done})) { for my $b (@blocks) { 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{blocks_array}}, {bug_num => $b, subject => $s{subject}, status => \%s}; } } - - + my $days = bug_archiveable(bug => $status{id}, + status => \%status, + days_until => 1, + ); + $status{archive_days} = $days; return fill_in_template(template => 'cgi/short_bug_status', variables => {status => \%status, isstrongseverity => \&Debbugs::Status::isstrongseverity, @@ -249,121 +255,9 @@ sub short_bug_status_html { '&version_url' => \&Debbugs::CGI::version_url, '&secs_to_english' => \&Debbugs::Common::secs_to_english, '&strftime' => \&POSIX::strftime, + '&maybelink' => \&Debbugs::CGI::maybelink, }, ); - - my $result = ""; - - my $showseverity; - if ($status{severity} eq 'normal') { - $showseverity = ''; - } - elsif (isstrongseverity($status{severity})) { - $showseverity = "Severity: $status{severity};\n"; - } - else { - $showseverity = "Severity: $status{severity};\n"; - } - - $result .= package_links(package => $status{package}, - options => $param{options}, - ); - - my $showversions = ''; - if (@{$status{found_versions}}) { - my @found = @{$status{found_versions}}; - $showversions .= join ', ', map {s{/}{ }; html_escape($_)} @found; - } - if (@{$status{fixed_versions}}) { - $showversions .= '; ' if length $showversions; - $showversions .= 'fixed: '; - my @fixed = @{$status{fixed_versions}}; - $showversions .= join ', ', map {s{/}{ }; html_escape($_)} @fixed; - } - $result .= ' ($showversions)} if length $showversions; - $result .= ";\n"; - - $result .= $showseverity; - $result .= "Reported by: ".package_links(submitter=>$status{originator}, - class => "submitter", - ); - $result .= ";\nOwned by: " . package_links(owner => $status{owner}, - class => "submitter", - ) - if length $status{owner}; - $result .= ";\nTags: " - . html_escape(join(", ", sort(split(/\s+/, $status{tags})))) - . "" - if (length($status{tags})); - - $result .= (length($status{mergedwith})?";\nMerged with ":"") . - bug_links(bug => [split(/ /,$status{mergedwith})], - class => "submitter", - ); - $result .= (length($status{blockedby})?";\nBlocked by ":"") . - bug_links(bug => [split(/ /,$status{blockedby})], - class => "submitter", - ); - $result .= (length($status{blocks})?";\nBlocks ":"") . - bug_links(bug => [split(/ /,$status{blocks})], - class => "submitter", - ); - - if (length($status{done})) { - $result .= "