Skip to content

Commit

Permalink
[backend] support container tracking for generic packages
Browse files Browse the repository at this point in the history
supports tracking of any published file (matching the supported suffixing)
if the binary file comes with another .report one.
  • Loading branch information
adrianschroeter committed Apr 25, 2018
1 parent fb7420b commit c975ff9
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
15 changes: 14 additions & 1 deletion src/backend/bs_publish
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ sub publish {
} elsif ($bin =~ /\.packages$/) {
$p = "$bin";
} elsif ($bin =~ /^(.*)\.report$/) {
# collect kiwi reports
# collect reports
$kiwireport{$1} = readxml("$r/$rbin", $BSXML::report, 1);
next;
} elsif ($bin =~ /^(.*)\.index$/) {
Expand Down Expand Up @@ -2028,6 +2028,19 @@ sub publish {
$pt->{'binaryarch'} = $res->{'arch'} if defined $res->{'arch'};
$pt->{'id'} = "$bin/$s[9]/$s[7]/$s[1]";
$packtrack->{$bin} = $pt;

# generic case like for python venv container in rpm
if ($bin =~ /.*\/(.*)$/ && $kiwireport{$1}) {
my $rpm_container = $1;
for my $kb (@{$kiwireport{$rpm_container}->{'binary'} || []}) {
my $pt = { %$kb };
delete $pt->{'_content'};
$pt->{'medium'} = $rpm_container;
my $fn = '';
$fn .= "/".(defined($pt->{$_}) ? $pt->{$_} : '') for qw{binaryarch name epoch version release};
$packtrack->{"$rpm_container$fn"} = $pt;
}
}
} elsif ($kiwimedium{$bin} && $kiwireport{$kiwimedium{$bin}}) {
my $medium = $bin;
$medium =~ s/.*\///; # basename
Expand Down
4 changes: 3 additions & 1 deletion src/backend/bs_worker
Original file line number Diff line number Diff line change
Expand Up @@ -3107,7 +3107,9 @@ sub dobuild {
if (($kiwimode || '') eq 'product' && !$followupmode && $kiwiorigins) {
createchannel("$buildroot/.build.packages/OTHER", $kiwiorigins);
}
if ((!$kiwimode || $kiwimode ne 'product') && !$followupmode && $kiwiorigins) {
if (!$kiwimode && !$followupmode && $kiwiorigins) {
createkiwireport("$buildroot/.build.packages/OTHER", $kiwiorigins);
} elsif ((!$kiwimode || $kiwimode ne 'product') && !$followupmode && $kiwiorigins) {
createkiwireport("$buildroot/.build.packages/KIWI", $kiwiorigins);
}
if (%$followupcopy) {
Expand Down

0 comments on commit c975ff9

Please sign in to comment.