Skip to content

Commit

Permalink
Support a new 'UseOBSRepositories' flag
Browse files Browse the repository at this point in the history
This will tell OBS that the container build should ignore the
repositories from the base container and from the package
manager calls, but insted use the repository configured in the
project path.

Note that this also means that the container cannot be built
outside of OBS.
  • Loading branch information
mlschroe committed Dec 5, 2018
1 parent ba85e6d commit 0f8d37d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Build/Docker.pm
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ sub parse {

my $basecontainer;
my $unorderedrepos;
my $useobsrepositories;
my $dockerfile_data = slurp($fn);
return { 'error' => 'could not open Dockerfile' } unless defined $dockerfile_data;

Expand All @@ -164,6 +165,9 @@ sub parse {
if ($line =~ /^#!UnorderedRepos\s*$/) {
$unorderedrepos = 1;
}
if ($line =~ /^#!UseOBSRepositories\s*$/) {
$useobsrepositories = 1;
}
next;
}
# add continuation lines
Expand Down Expand Up @@ -224,6 +228,7 @@ sub parse {
s/<VERSION>/$version/g if defined $version;
s/<RELEASE>/$release/g if defined $release;
}
$ret->{'path'} = [ { 'project' => '_obsrepositories', 'repository' => '' } ] if $useobsrepositories;
return $ret;
}

Expand Down

0 comments on commit 0f8d37d

Please sign in to comment.