Skip to content

Commit

Permalink
Merge pull request #8219 from mlschroe/master
Browse files Browse the repository at this point in the history
[backend] make the deltagen -m option configurable
  • Loading branch information
mlschroe committed Sep 6, 2019
2 parents 61e71d7 + 524a3a5 commit 494f5cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
18 changes: 18 additions & 0 deletions src/backend/bs_worker
Original file line number Diff line number Diff line change
Expand Up @@ -3062,6 +3062,24 @@ sub dobuild {
my $config = BSRPC::rpc("$server/getconfig", undef, "project=$projid", "repository=$repoid", @configpath);
writestr("$buildroot/.build.config", undef, $config);

if ($deltamode) {
# replace @mopt@ in specfile
my $spec = readstr("$srcdir/worker-deltagen.spec");
my $mopt;
$mopt = $BSConfig::deltagen_mopt if defined $BSConfig::deltagen_mopt;
importbuild() unless defined &Build::queryhdrmd5;
eval {
my $bconf = Build::read_config($buildinfo->{'arch'}, [ split("\n", $config) ]);
for (@{$bconf->{'repotype'}}) {
$mopt = $1 eq '' ? undef : $1 if /^deltagen-mopt:(\d*)/;
}
};
$mopt = 512 unless defined $mopt;
$mopt = '' unless $mopt;
$spec =~ s/\@mopt\@/$mopt/sg;
writestr("$srcdir/worker-deltagen.spec", undef, $spec);
}

my $release = $buildinfo->{'release'};
#FIXME2.6: drop the following line
my $disturl = "obs://$BSConfig::obsname/$projid/$repoid/$buildinfo->{'srcmd5'}-$packid";
Expand Down
6 changes: 4 additions & 2 deletions src/backend/worker-deltagen.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ mkdir -p "$odir"
# check if makedeltarpm supports the '-m' option
mopt=
case `makedeltarpm -m 512 /dev/null /dev/null /dev/null 2>&1` in
if test -n "@mopt@" ; them
case `makedeltarpm -m @mopt@ /dev/null /dev/null /dev/null 2>&1` in
*invalid\ option*) ;;
*) mopt="-m 512" ;;
*) mopt="-m @mopt@" ;;
esac
fi
for i in *.old ; do
if ! test -e "$i"; then
Expand Down

0 comments on commit 494f5cd

Please sign in to comment.