From: Frank Lichtenheld Date: Mon, 20 Feb 2006 15:29:42 +0000 (+0000) Subject: change read_entry_simple again to use X-Git-Tag: switch-to-templates~100 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=a7c90835e393ff56dd9c84f022347554325bc916;p=deb%2Fpackages.git change read_entry_simple again to use real package > virtual package > fuzzy real package > fuzzy virtual package (Better would probably be to return real and virtual packages seperatly to give the caller more choice over what preferences he wants) --- diff --git a/lib/Packages/Search.pm b/lib/Packages/Search.pm index ba3b68c..32ef1e2 100644 --- a/lib/Packages/Search.pm +++ b/lib/Packages/Search.pm @@ -365,7 +365,7 @@ sub read_entry_simple { my $result = $hash->{$key} || ''; debug( "read_entry_simple: key=$key, archives=". join(" ",(keys %$archives)).", suite=$suite", 1); - my @data_fuzzy; + my (@data_fuzzy, @data_virtual, @data_fuzzy_virtual); foreach (split /\000/o, $result) { my @data = split ( /\s/o, $_, 8 ); debug( "Considering entry ".join( ':', @data), 2); @@ -376,14 +376,20 @@ sub read_entry_simple { return \@data; } elsif ($archives->{$data[0]}) { debug( "Virtual entry ".join( ':', @data), 2); + @data_virtual = @data; + } elsif (($data[0] eq 'us') + && ($data[2] ne 'virtual')) { + debug( "Fuzzy entry ".join( ':', @data), 2); @data_fuzzy = @data; } elsif ($data[0] eq 'us') { - debug( "Fuzzy entry ".join( ':', @data), 2); - @data_fuzzy = @data unless @data_fuzzy; + debug( "Virtual fuzzy entry ".join( ':', @data), 2); + @data_fuzzy_virtual = @data; } } } - return \@data_fuzzy; + return \@data_virtual if @data_virtual; + return \@data_fuzzy if @data_fuzzy; + return \@data_fuzzy_virtual; } sub read_src_entry_all { my ($hash, $key, $results, $non_results, $opts) = @_;