From 9d349f22eda0818498a2cfc1c7470c135a656011 Mon Sep 17 00:00:00 2001 From: joy <> Date: Sun, 24 Aug 2003 09:47:55 -0800 Subject: [PATCH] [project @ 2003-08-24 10:47:55 by joy] found out another corner case that wasn't covered, and finally rearranged the @references logic to be straightforward (albeit boring and somewhat repetitive) --- cgi/pkgreport.cgi | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/cgi/pkgreport.cgi b/cgi/pkgreport.cgi index b6fa44ee..6332888d 100755 --- a/cgi/pkgreport.cgi +++ b/cgi/pkgreport.cgi @@ -263,7 +263,6 @@ if (defined $pkg || defined $src) { } my @pkgs = getsrcpkgs($pkg ? $srcforpkg : $src); undef $srcforpkg unless @pkgs; - my @references; @pkgs = grep( !/^\Q$pkg\E$/, @pkgs ) if ( $pkg ); if ( @pkgs ) { @pkgs = sort @pkgs; @@ -275,23 +274,22 @@ if (defined $pkg || defined $src) { push @pkgs, $src if ( $src && !grep(/^\Q$src\E$/, @pkgs) ); print join( ", ", map( "$_", @pkgs ) ); print ".\n"; + } + my @references; + my $pseudodesc = getpseudodesc(); + if ($pkg and defined($pseudodesc) and exists($pseudodesc->{$pkg})) { + push @references, "to the list of other pseudo-packages"; + } else { + if ($pkg) { + push @references, sprintf "to the %s package page", urlsanit("http://${debbugs::gPackagePages}/$pkg"), htmlsanit("$pkg"); + } if (defined $debbugs::gSubscriptionDomain) { my $ptslink = $pkg ? $srcforpkg : $src; push @references, "to the Package Tracking System"; } - } - if ($pkg) { - my $pseudodesc = getpseudodesc(); - if (defined($pseudodesc) and exists($pseudodesc->{$pkg})) { - push @references, "to the list of other pseudo-packages"; - } else { - push @references, sprintf "to the %s package page", urlsanit("http://${debbugs::gPackagePages}/$pkg"), htmlsanit("$pkg"); - } - if ($srcforpkg) { - # Only output this if the source listing is non-trivial. - if (@pkgs or $pkg ne $srcforpkg) { - push @references, sprintf "to the source package %s's bug page", srcurl($srcforpkg), htmlsanit($srcforpkg); - } + # Only output this if the source listing is non-trivial. + if ($pkg and $srcforpkg and (@pkgs or $pkg ne $srcforpkg)) { + push @references, sprintf "to the source package %s's bug page", srcurl($srcforpkg), htmlsanit($srcforpkg); } } if (@references) { -- 2.39.5