Skip to content

Commit

Permalink
[backend] support container downloading via the interconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Oct 6, 2017
1 parent e4d80b3 commit 4bd9ec7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
12 changes: 10 additions & 2 deletions src/backend/BSSrcServer/Remote.pm
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,11 @@ sub getremotebinaryversions {
return undef if $BSStdServer::isajax && !$bvl;
for (@{$bvl->{'binary'} || []}) {
my $bin = $_->{'name'};
$bin =~ s/\.(?:$binsufsre)$//;
if ($bin =~ /^container:/) {
$bin =~ s/\.tar(?:\..+)?$//;
} else {
$bin =~ s/\.(?:$binsufsre)$//;
}
$binaryversions->{$bin} = $_;
}
# make sure that we don't loop forever if the server returns incomplete data
Expand Down Expand Up @@ -735,7 +739,11 @@ sub getremotebinaries {
for my $f (@{$cpio || []}) {
my $bin = $f->{'name'};
$bin =~ s/^upload.*?://;
$bin =~ s/\.(?:$binsufsre)$//;
if ($bin =~ /^container:/) {
$bin =~ s/\.tar(?:\..+)?$//;
} else {
$bin =~ s/\.(?:$binsufsre)$//;
}
if (!$fetch{$bin}) {
unlink("$remotecache/$f->{'name'}");
next;
Expand Down
8 changes: 6 additions & 2 deletions src/backend/bs_repserver
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,14 @@ sub getbinarylist_repository {
}
my $path = $pool->pkg2path($p);
my $n = $bin;
$n .= ".$1" if $path =~ /\.($binsufsre)$/;
if ($bin =~ /^container:/ && $path =~ /(\.tar(?:\..+)?)$/) {
$n .= $1;
} else {
$n .= ".$1" if $path =~ /\.($binsufsre)$/;
}
my $r = {'filename' => $view eq 'names' ? $n : $path };
my $id = $pool->pkg2bsid($p);
if ($id) {
if ($id && $bin !~ /^container:/) {
if ($id eq 'dod') {
$r->{'mtime'} = '';
$r->{'size'} = '';
Expand Down

0 comments on commit 4bd9ec7

Please sign in to comment.