next if $suite eq '-';
if ($opts->{h_suites}{$suite}) {
push @$results, [ $key, "-", $suite, 'virtual', 'v', 'v', 'v', 'v',
- (split /\s/, $provides)];
+ $provides];
} else {
push @$non_results, [ $key, "-", $suite, 'virtual', 'v', 'v', 'v', 'v',
- (split /\s/, $provides)];
+ $provides];
}
}
my @non_results;
read_entry_all( $hash, $key, $results, \@non_results, $opts );
}
+
+#FIXME: make configurable
+my %fallback_suites = (
+ 'stable-backports' => 'stable',
+ 'stable-volatile' => 'stable',
+ experimental => 'unstable' );
+
sub read_entry_simple {
my ($hash, $key, $archives, $suite) = @_;
# FIXME: drop $archives
my ($virt, $result) = split /\000/o, $hash->{$key} || "-\01-\0", 2;
my %virt = split /\01/o, $virt;
debug( "read_entry_simple: key=$key, archives=".
- join(" ",(keys %$archives)).", suite=$suite", 1);
- # FIXME: magically encoded a max of 7 suites here by the '8'
- foreach (split /\000/o, $result, 8) {
+ join(" ",(keys %$archives)).", suite=$suite", 1) if DEBUG;
+ return [ $virt{$suite} ] unless defined $result;
+ foreach (split /\000/o, $result) {
my @data = split ( /\s/o, $_, 8 );
+ debug( "use entry: @data", 2 ) if DEBUG && $data[1] eq $suite;
return [ $virt{$suite}, @data ] if $data[1] eq $suite;
}
+ if (my $fb_suite = $fallback_suites{$suite}) {
+ my $fb_result = read_entry_simple( $hash, $key, $archives, $fb_suite );
+ my $fb_virt = shift(@$fb_result);
+ $virt{$suite} .= $fb_virt if $fb_virt;
+ return [ $virt{$suite}, @$fb_result ] if @$fb_result;
+ }
return [ $virt{$suite} ];
}