From f713acc32b708beb2756e49385259be7b8341c6b Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Thu, 23 Nov 2006 22:24:05 +0000 Subject: [PATCH] make sure all_architectures is sorted some whitespace fixes --- lib/Packages/DoSearchContents.pm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index f512ec4..101c10c 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -82,7 +82,7 @@ sub do_search_contents { if @keywords; my $kw = reverse $first_kw; - + # exact filename searching follows trivially: $kw = "$kw/" if $mode eq 'exactfilename'; @@ -91,11 +91,11 @@ sub do_search_contents { $reverses = undef; untie %reverses; - + my $st1 = new Benchmark; my $std = timediff($st1, $st0); debug( "Search took ".timestr($std) ) if DEBUG; - } + } my (%results,%archs); foreach my $result (sort { $a->[0] cmp $b->[0] } @results) { @@ -110,8 +110,8 @@ sub do_search_contents { next unless keys %pkgs; $results{$file} = \%pkgs; } - my @all_archs = keys %archs; - @all_archs = @ARCHITECTURES unless @all_archs; + my @all_archs = sort keys %archs; + @all_archs = sort @ARCHITECTURES unless @all_archs; $page_content->{suite} = $suite; $page_content->{archive} = $archive; $page_content->{all_architectures} = \@all_archs; @@ -164,7 +164,7 @@ sub searchfile debug( "searchfile: kw=$kw", 1 ) if DEBUG; for (my $status = $reverses->seq($key, $value, R_CURSOR); $status == 0; - $status = $reverses->seq( $key, $value, R_NEXT)) { + $status = $reverses->seq( $key, $value, R_NEXT)) { # FIXME: what's the most efficient "is prefix of" thingy? We only want to know # whether $kw is or is not a prefix of $key -- 2.39.2