- if ($params_def->{$param}{array} && defined $p_value_orig) {
- @p_value = split /$params_def->{$param}{array}/, $p_value_orig;
- print "DEBUG: Value (Array Split) ".
- join('##',@p_value)."<br>" if $debug;
- }
+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) if DEBUG;
+ debug( "read_entry_simple: virt=".join(" ",(%virt)), 2) if DEBUG;
+ # FIXME: not all of the 2^4=16 combinations of empty(results),
+ # empty(virt{suite}), empty(fb_result), empty(virt{fb_suite}) are dealt
+ # with correctly, but it's adequate enough for now
+ return [ $virt{$suite} ] unless defined $result;
+ foreach (split /\000/o, $result) {
+ my @data = split ( /\s/o, $_, 9 );
+ 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_suite($suite)) {
+ my $fb_result = read_entry_simple( $hash, $key, $archives, $fb_suite );
+ my $fb_virt = shift(@$fb_result);
+ $virt{$suite} .= $virt{$suite} ? " $fb_virt" : $fb_virt if $fb_virt;
+ return [ $virt{$suite}, @$fb_result ] if @$fb_result;
+ }
+ return [ $virt{$suite} ];
+}