}
if (exists $param{affects}) {
my @aff_list = make_list($param{affects});
+ s/^src:// foreach @aff_list;
$rs = $rs->search({-or => {'bin_pkg.pkg' =>
[@aff_list],
'src_pkg.pkg' =>
$rs = $rs->search({-or => {'bug_binpackages.bin_pkg' =>
{ -in => $bin_pkgs_rs->get_column('id')->as_query},
'bug_srcpackages.src_pkg' =>
- { -in => $bin_pkgs_rs->get_column('id')->as_query},
+ { -in => $src_pkgs_rs->get_column('id')->as_query},
},
},
{join => ['bug_binpackages',
search({-or => [map {('me.pkg' => $_,
)}
make_list($param{src})],
- columns => ['id'],
+ },
+ { columns => ['id'],
group_by => ['me.id'],
},
);
});
$rs = $rs->search({-or => {'bug_binpackages.bin_pkg' =>
{ -in => $bin_pkgs_rs->get_column('id')->as_query},
- 'bug_srcpackages.src_pkg' =>
- { -in => $bin_pkgs_rs->get_column('id')->as_query},
+ 'bug_srcpackages.src_pkg' =>
+ { -in => $src_pkgs_rs->get_column('id')->as_query},
'me.unknown_packages' =>
[make_list($param{src})],
},
my @archs = grep {defined $_} make_list(exists $param{arch}?$param{arch}:[]);
return () unless @binaries;
+ my $cache_key = join("\1",
+ join("\0",@binaries),
+ join("\0",@versions),
+ join("\0",@archs),
+ join("\0",@param{qw(source_only scalar_only)}));
+ if (exists $param{cache}{$cache_key}) {
+ return $param{scalar_only} ? $param{cache}{$cache_key}[0]:
+ @{$param{cache}{$cache_key}};
+ }
# any src:foo is source package foo with unspecified version
@source = map {/^src:(.+)$/?
[$1,'']:()} @binaries;
push @source,
map {$_->{pkg}} $src_rs->all;
if ($param{scalar_only}) {
- return join(',',@source);
+ @source = join(',',@source);
}
- return @source;
-
+ $param{cache}{$cache_key} = \@source;
+ return $param{scalar_only}?$source[0]:@source;
}
my $src_rs = $param{schema}->resultset('SrcVer')->
search_rs({'bin_pkg.pkg' => [@binaries],
$_->{src_vers}{ver},
]} $src_rs->all;
}
- return @source;
- }
- my $cache_key = join("\1",
- join("\0",@binaries),
- join("\0",@versions),
- join("\0",@archs),
- join("\0",@param{qw(source_only scalar_only)}));
- if (exists $param{cache}{$cache_key}) {
- return $param{scalar_only} ? $param{cache}{$cache_key}[0]:
- @{$param{cache}{$cache_key}};
+ $param{cache}{$cache_key} = \@source;
+ return $param{scalar_only}?$source[0]:@source;
}
for my $binary (@binaries) {
_tie_binarytosource;