From: Don Armstrong Date: Thu, 25 Sep 2008 03:19:11 +0000 (-0700) Subject: * Fix link to pseudopackages X-Git-Tag: release/2.6.0~468^2 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fe3cb56ad04bdfdd05bb7066514228657180105c;p=debbugs.git * Fix link to pseudopackages * Add back link to reporting instructions * Fix source entry for psuedopackages on bugreport_pkginfo.tmpl --- diff --git a/Debbugs/CGI/Pkgreport.pm b/Debbugs/CGI/Pkgreport.pm index 085b31ea..beba95a8 100644 --- a/Debbugs/CGI/Pkgreport.pm +++ b/Debbugs/CGI/Pkgreport.pm @@ -129,17 +129,18 @@ 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"; } 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); + push @references, q(to the Package Tracking System); } # Only output this if the source listing is non-trivial. if ($param{binary} and $srcforpkg) { @@ -154,12 +155,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}"); + html_escape("http://$config{web_domain}/Reporting$config{html_suffix}"); } - if (not $maint and not @{$param{bugs}}) { + if (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.

"; diff --git a/cgi/bugreport.cgi b/cgi/bugreport.cgi index f3c7ff6f..456bd69e 100755 --- a/cgi/bugreport.cgi +++ b/cgi/bugreport.cgi @@ -259,7 +259,7 @@ my @packages = splitpackages($status{package}); foreach my $pkg (@packages) { $package{$pkg} = {maintainer => exists($maintainer{$pkg}) ? $maintainer{$pkg} : '(unknown)', - source => exists($pkgsrc{$pkg}) ? $pkgsrc{$pkg} : '(unknown)', + exists($pkgsrc{$pkg}) ? (source => $pkgsrc{$pkg}) : (), package => $pkg, }; } diff --git a/templates/en_US/cgi/bugreport_pkginfo.tmpl b/templates/en_US/cgi/bugreport_pkginfo.tmpl index 22806f7c..4a39ba37 100644 --- a/templates/en_US/cgi/bugreport_pkginfo.tmpl +++ b/templates/en_US/cgi/bugreport_pkginfo.tmpl @@ -8,8 +8,10 @@ for my $package (values %package) { $output .= q(Maintainer for ).package_links(package=>$package->{package}).qq( is ). package_links(maintainer => $package->{maintainer}).qq(; ); - $output .= q(Source for ).package_links(package=>$package->{package}).qq( is ). - package_links(source => $package->{source}).qq(. ); + if (exists $package->{source}) { + $output .= q(Source for ).package_links(package=>$package->{package}).qq( is ). + package_links(source => $package->{source}).qq(. ); + } } $output; }