From: cjwatson <>
Date: Mon, 21 Oct 2002 06:59:40 +0000 (-0800)
Subject: [project @ 2002-10-20 23:59:40 by cjwatson]
X-Git-Tag: release/2.6.0~1021
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=92fb41a370196134c8d8d46a5007417d0b6770f4;p=debbugs.git
[project @ 2002-10-20 23:59:40 by cjwatson]
Give better feedback when querying a non-existent package name.
---
diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi
index 7dd5aa1d..c98da922 100755
--- a/cgi/pkgreport.cgi
+++ b/cgi/pkgreport.cgi
@@ -175,6 +175,8 @@ print "
\n" .
print "" . "$debbugs::gProject$Archived $debbugs::gBug report logs: $tag" .
"
\n";
+my $showresult = 1;
+
if (defined $pkg || defined $src) {
my %maintainers = %{getmaintainers()};
my $maint = $pkg ? $maintainers{$pkg} : $maintainers{$src} ? $maintainers{$src} : undef;
@@ -183,31 +185,38 @@ if (defined $pkg || defined $src) {
. mainturl($maint) . "\">"
. htmlsanit($maint) . ".\n";
}
- my %pkgsrc = %{getpkgsrc()};
- my @pkgs = getsrcpkgs($pkg ? $pkgsrc{ $pkg } : $src);
- @pkgs = grep( !/^\Q$pkg\E$/, @pkgs ) if ( $pkg );
- if ( @pkgs ) {
- @pkgs = sort @pkgs;
- if ($pkg) {
- print "You may want to refer to the following packages that are part of the same source:
\n";
- } else {
- print "You may want to refer to the following individual bug pages:
\n";
+ if (defined $maint or @bugs) {
+ my %pkgsrc = %{getpkgsrc()};
+ my @pkgs = getsrcpkgs($pkg ? $pkgsrc{ $pkg } : $src);
+ @pkgs = grep( !/^\Q$pkg\E$/, @pkgs ) if ( $pkg );
+ if ( @pkgs ) {
+ @pkgs = sort @pkgs;
+ if ($pkg) {
+ print "You may want to refer to the following packages that are part of the same source:
\n";
+ } else {
+ print "You may want to refer to the following individual bug pages:
\n";
+ }
+ push @pkgs, $src if ( $src && !grep(/^\Q$src\E$/, @pkgs) );
+ print join( ", ", map( "$_", @pkgs ) );
+ print ".\n";
}
- push @pkgs, $src if ( $src && !grep(/^\Q$src\E$/, @pkgs) );
- print join( ", ", map( "$_", @pkgs ) );
- print ".\n";
- }
- if ($pkg) {
- printf "You might like to refer to the %s package page", urlsanit("http://${debbugs::gPackagePages}/$pkg"), htmlsanit("$pkg");
- if ($pkgsrc{ $pkg }) {
- printf ", or to the source package %s's bug page.
\n", srcurl($pkgsrc{$pkg}), htmlsanit($pkgsrc{$pkg});
- } else {
- printf ".\n";
+ if ($pkg) {
+ printf "You might like to refer to the %s package page", urlsanit("http://${debbugs::gPackagePages}/$pkg"), htmlsanit("$pkg");
+ if ($pkgsrc{ $pkg }) {
+ printf ", or to the source package %s's bug page.
\n", srcurl($pkgsrc{$pkg}), htmlsanit($pkgsrc{$pkg});
+ } else {
+ printf ".\n";
+ }
}
+ print "If you find a bug not listed here, please\n";
+ printf "report it.
\n",
+ urlsanit("http://${debbugs::gWebDomain}/Reporting.html");
+ } else {
+ print "There is no record of the " .
+ (defined($pkg) ? "$pkg package" : "$src source package") .
+ ", and no bugs have been filed against it.
";
+ $showresult = 0;
}
- print "If you find a bug not listed here, please\n";
- printf "report it.
\n",
- urlsanit("http://${debbugs::gWebDomain}/Reporting.html");
} elsif (defined $maint || defined $maintenc) {
print "Note that maintainers may use different Maintainer fields for\n";
print "different packages, so there may be other reports filed under\n";
@@ -218,7 +227,7 @@ if (defined $pkg || defined $src) {
print "different addresses.\n";
}
-print $result;
+print $result if $showresult;
print "
\n";
print "$tail_html";
diff --git a/debian/changelog b/debian/changelog
index 176be61d..75c823c1 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -73,6 +73,8 @@ debbugs (2.4) experimental; urgency=low
* Be more careful about loop detection, closes: #113514. [Adam, Colin]
* Relax the syntax for 'tags' slightly, since people seem to use it that
way accidentally a lot, closes: #96164. [Colin]
+ * Give better feedback from pkgreport.cgi when querying a non-existent
+ package name, closes: #93433. [Colin]
* Fix a few typos, closes: #146745, #152751.
* Various other things, not worth mentioning here.