Skip to content

Commit

Permalink
[backend] use new Build::parse_depfile function to read the ldeps file
Browse files Browse the repository at this point in the history
This is a much saner approach than calling Build::readdeps and fixing up
the dependencies of the packages.
  • Loading branch information
mlschroe committed May 18, 2020
1 parent c39bdec commit 4cafda7
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/backend/BSRepServer/Checker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,18 @@ sub depstotestcaseformat {
sub addldeprepo {
my ($pool, $bconf, $ldepfile) = @_;
my $data = {};
Build::readdeps({ %$bconf }, $data, $ldepfile);
# repofromdata expects testcase format, so convert rich dependencies
if (defined &Build::Rpm::testcaseformat) {
for my $p (values %$data) {
for ('requires', 'conflicts', 'recommends', 'supplements') {
depstotestcaseformat($p->{$_}) if $p->{$_};
if (defined &Build::parse_depfile) {
my $nofiledeps = %{$bconf->{'fileprovides'} || {}} ? 0 : 1;
$data = Build::parse_depfile($ldepfile, [], 'testcaseformat' => 1, 'nofiledeps' => $nofiledeps);
$data = { map {$_ => $_} @$data }; # convert from array to hash
} else {
Build::readdeps({ %$bconf }, $data, $ldepfile);
# repofromdata expects testcase format, so convert rich dependencies
if (defined &Build::Rpm::testcaseformat) {
for my $p (values %$data) {
for ('requires', 'conflicts', 'recommends', 'supplements') {
depstotestcaseformat($p->{$_}) if $p->{$_};
}
}
}
}
Expand Down

0 comments on commit 4cafda7

Please sign in to comment.