From: Frank Lichtenheld Date: Tue, 14 Feb 2006 02:45:43 +0000 (+0000) Subject: Handle security and non-US correctly X-Git-Tag: switch-to-templates~126 X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=7dfbd8a2e4576f56679f47dd37ec8ac4ff4f9d5c;p=deb%2Fpackages.git Handle security and non-US correctly --- diff --git a/cgi-bin/search_packages.pl b/cgi-bin/search_packages.pl index c74ffc2..a7184dc 100755 --- a/cgi-bin/search_packages.pl +++ b/cgi-bin/search_packages.pl @@ -255,7 +255,7 @@ print_errors(); print_hints(); print_debug(); if (@results) { - my (%pkgs, %subsect, %sect, %desc, %binaries, %provided_by); + my (%pkgs, %subsect, %sect, %archives, %desc, %binaries, %provided_by); unless ($opts{searchon} eq 'sourcenames') { foreach (@results) { @@ -264,10 +264,18 @@ if (@results) { my ($pkg) = $pkg_t =~ m/^(.+)/; # untaint if ($arch ne 'virtual') { + my $real_archive; + if ($archive =~ /^(security|non-US)$/) { + $real_archive = $archive; + $archive = 'us'; + } + $pkgs{$pkg}{$suite}{$archive}{$version}{$arch} = 1; $subsect{$pkg}{$suite}{$archive}{$version} = $subsection; $sect{$pkg}{$suite}{$archive}{$version} = $section unless $section eq 'main'; + $archives{$pkg}{$suite}{$archive}{$version} = $real_archive + if $real_archive; $desc{$pkg}{$suite}{$archive}{$version} = $desc; } else { @@ -288,8 +296,11 @@ my @pkgs = sort(keys %pkgs, keys %provided_by); print "