Skip to content

Commit

Permalink
[backend] add module support to getbinariesproxy and getpreinstallimage
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Nov 7, 2019
1 parent 6d9034b commit 82ca59d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/backend/bs_getbinariesproxy
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ sub getbinaries {
push @args, "repository=$repoid";
push @args, "arch=$arch";
push @args, "nometa" if $nometa;
push @args, map {"module=$_"} @{$cgi->{'module'} || []};
push @args, "binaries=".join(',', @missingbvs);
my $bvl;
eval {
Expand Down Expand Up @@ -300,6 +301,7 @@ sub getbinaries {
push @args, "project=$projid";
push @args, "repository=$repoid";
push @args, "arch=$arch";
push @args, map {"module=$_"} @{$cgi->{'module'} || []};
my $res = BSRPC::rpc({
'uri' => "$server/getbinaries",
'directory' => $cachetmpdir,
Expand Down Expand Up @@ -406,7 +408,7 @@ sub hello {

my $dispatches = [
'/' => \&hello,
'/getbinaries $project $repository $arch binaries: nometa:bool? metaonly:bool? workerid? server:' => \&getbinaries,
'/getbinaries $project $repository $arch binaries: nometa:bool? metaonly:bool? module* workerid? server:' => \&getbinaries,
'/getpreinstallimage $prpa $hdrmd5:md5 path: sizek:num? workerid? server:' => \&getpreinstallimage,
];

Expand Down
6 changes: 5 additions & 1 deletion src/backend/bs_worker
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,7 @@ sub getpreinstallimage {
push @args, "repository=$repo->{'repository'}";
push @args, "arch=$buildinfo->{'arch'}";
push @args, "nometa" if $nometa;
push @args, map {"module=$_"} @{$buildinfo->{'module'} || []};
push @args, "binaries=".join(',', @bins);
my $bvl;
eval {
Expand Down Expand Up @@ -2165,6 +2166,7 @@ sub getbinaries_buildenv {
push @args, "repository=$repo->{'repository'}";
push @args, "arch=$arch";
push @args, 'nometa';
push @args, map {"module=$_"} @{$buildinfo->{'module'} || []};
push @args, "binaries=".join(',', @needed_names);
my $bvl;
eval {
Expand Down Expand Up @@ -2237,6 +2239,7 @@ sub getbinaries_buildenv {
my $projid = $repo->{'project'};
my $repoid = $repo->{'repository'};
my $param;
my @args;
unlink("$dir/$bv->{'name'}");
if ($bv->{'package'}) {
$param = {
Expand All @@ -2246,6 +2249,7 @@ sub getbinaries_buildenv {
'filename' => "$dir/$bv->{'name'}",
};
} else {
push @args, map {"module=$_"} @{$buildinfo->{'module'} || []};
$param = {
'uri' => "$server/build/$projid/$repoid/$arch/_repository/$bv->{'name'}",
'timeout' => $gettimeout,
Expand All @@ -2254,7 +2258,7 @@ sub getbinaries_buildenv {
};
}
eval {
BSRPC::rpc($param);
BSRPC::rpc($param, undef, @args);
};
if ($@) {
warn($@);
Expand Down

0 comments on commit 82ca59d

Please sign in to comment.