Skip to content

Commit

Permalink
Merge pull request #15671 from adrianschroeter/no_updateinfo
Browse files Browse the repository at this point in the history
[backend] patchinfo: allow to skip updateinfo.xml generation
  • Loading branch information
adrianschroeter committed Feb 22, 2024
2 parents 65d14fb + 6e99521 commit 96fd7dd
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
8 changes: 7 additions & 1 deletion docs/api/api/patchinfo.rng
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,12 @@
</element>

<optional>
<element name="stopped">
<element name="seperate_build_arch">
<empty/>
</element>
</optional>
<optional>
<element name="stopped">
<text/>
</element>
</optional>
Expand Down Expand Up @@ -133,6 +138,7 @@
<value>optional</value>
<value>feature</value>
<value>ptf</value>
<value>no_updateinfo</value>
</choice>
</define>

Expand Down
14 changes: 10 additions & 4 deletions src/backend/BSSched/BuildJob/Patchinfo.pm
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ sub check {
my $myarch = $gctx->{'arch'};
my @archs = @{$repo->{'arch'}};
return ('broken', 'missing archs') unless @archs; # can't happen
my $buildarch = $archs[0]; # always build in first arch
my $patchinfo = $pdata->{'patchinfo'};
if (exists $patchinfo->{'seperate_build_arch'}) {
# build on all schedulers, but don't take content from each other
@archs = ($myarch);
};
my $buildarch = $archs[0];
my $reporoot = $gctx->{'reporoot'};
my $markerdir = "$reporoot/$prp/$buildarch/$packid";
my $patchinfo = $pdata->{'patchinfo'};
my $projpacks = $gctx->{'projpacks'};
my $proj = $projpacks->{$projid} || {};

Expand Down Expand Up @@ -719,8 +723,10 @@ sub build {
};
$update->{'pkglist'} = {'collection' => [ $col ] };
$update->{'patchinforef'} = "$projid/$packid"; # deleted in publisher...
writexml("$jobdatadir/updateinfo.xml", undef, {'update' => [$update]}, $BSXML::updateinfo);
$bininfo->{'updateinfo.xml'} = genbininfo($jobdatadir, 'updateinfo.xml');
if ($category ne 'no_updateinfo') {
writexml("$jobdatadir/updateinfo.xml", undef, {'update' => [$update]}, $BSXML::updateinfo);
$bininfo->{'updateinfo.xml'} = genbininfo($jobdatadir, 'updateinfo.xml');
};
writestr("$jobdatadir/logfile", undef, "update built succeeded ".localtime($now)."\n");
$updateinfodata = {
'packages' => \@tocopy,
Expand Down
2 changes: 1 addition & 1 deletion src/backend/BSVerify.pm
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ sub verify_patchinfo {
# This verifies the absolute minimum required content of a patchinfo file
my $p = $_[0];
verify_filename($p->{'name'}) if defined($p->{'name'});
my %allowed_categories = map {$_ => 1} qw{security recommended optional feature ptf};
my %allowed_categories = map {$_ => 1} qw{security recommended optional feature ptf no_updateinfo};
die("Invalid category defined in _patchinfo\n") if defined($p->{'category'}) && !$allowed_categories{$p->{'category'}};
for my $rt (@{$p->{'releasetarget'} || []}) {
verify_projid($rt->{'project'});
Expand Down
1 change: 1 addition & 0 deletions src/backend/BSXML.pm
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ our $patchinfo = [
'packager',
'retracted',
'stopped',
'seperate_build_arch', # for builds on each scheduler arch
'zypp_restart_needed',
'reboot_needed',
'relogin_needed',
Expand Down

0 comments on commit 96fd7dd

Please sign in to comment.