X-Git-Url: https://git.deb.at/?a=blobdiff_plain;f=lib%2FPackages%2FDoSearchContents.pm;h=73955d36556e6a3e10f503de3a87b20918dc9a6f;hb=bc4124c53d65b5ddf5a0504d0479b06aa7cfcb8b;hp=1be7d441cc90e25c6da65a0b855a2916d809e8ff;hpb=aee28210328cf1867daba3d397bf77d0baa24ccc;p=deb%2Fpackages.git diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index 1be7d44..73955d3 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -5,8 +5,6 @@ use warnings; use Benchmark ':hireswallclock'; use DB_File; -use URI::Escape; -use HTML::Entities; use Exporter; our @ISA = qw( Exporter ); our @EXPORT = qw( do_search_contents ); @@ -34,7 +32,7 @@ sub do_search_contents { #FIXME: that's extremely hacky atm if ($params->{values}{suite}{no_replace}[0] eq 'default') { $params->{values}{suite}{no_replace} = - $params->{values}{suite}{final} = $opts->{suite} = [ 'etch' ]; + $params->{values}{suite}{final} = $opts->{suite} = [ 'gutsy' ]; } if (@{$opts->{suite}} > 1) { @@ -173,8 +171,15 @@ sub searchfile last unless index($key, $kw) == 0; debug( "found $key", 2 ) if DEBUG; - my @hits = split /\0/o, $value; - push @$results, [ scalar reverse($key), @hits ]; + my @files = split /\001/o, $value; + foreach my $f (@files) { + my @hits = split /\0/o, $f; + my $file = shift @hits; + if ($file eq '-') { + $file = reverse($key); + } + push @$results, [ $file, @hits ]; + } last if ($$nres)++ > 100; }