Skip to content

Commit

Permalink
[backend] fix reportfile handling for venv rpms
Browse files Browse the repository at this point in the history
Nowadays the reportfile has an arch prefix in the hash so that
reports from different archs do not overwrite each other.
  • Loading branch information
mlschroe committed Apr 26, 2018
1 parent f78a068 commit aa5dd4f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/backend/bs_publish
Original file line number Diff line number Diff line change
Expand Up @@ -2005,6 +2005,7 @@ sub publish {
$packtrack = $dbgpacktrack || {};
my %cache = @{$packtrackcache || []};
for my $bin (sort keys %bins) {
my $reportfile;
if ($bin =~ /\.(?:$binsufsre)$/) {
my $res;
my @s = stat("$extrep/$bin");
Expand Down Expand Up @@ -2032,6 +2033,11 @@ sub publish {
$pt->{'binaryarch'} = $res->{'arch'} if defined $res->{'arch'};
$pt->{'id'} = "$bin/$s[9]/$s[7]/$s[1]";
$packtrack->{$bin} = $pt;
if ($pt->{'arch'}) {
$reportfile = $bin;
$reportfile =~ s/.*\///; # basename
$reportfile = "$pt->{'arch'}/$reportfile";
}
}

# track containers
Expand All @@ -2053,7 +2059,7 @@ sub publish {
}

# track kiwi images and kiwi products
if (!$containers{$bin} && $kiwireport{$kiwimedium{$bin}}) {
if (!$containers{$bin} && $kiwimedium{$bin} && $kiwireport{$kiwimedium{$bin}}) {
my $medium = $bin;
$medium =~ s/.*\///; # basename
my $pt = { 'project' => $projid, 'repository' => $repoid };
Expand All @@ -2066,9 +2072,8 @@ sub publish {
}

# check if there is a report associated with this binary
my $reportfile = $kiwimedium{$bin};
$reportfile = $1 if !$reportfile && $bin =~ /([^\/]+\.(?:$binsufsre))$/;
if ($kiwireport{$reportfile}) {
$reportfile = $kiwimedium{$bin} if $kiwimedium{$bin};
if ($reportfile && $kiwireport{$reportfile}) {
my $medium = $bin;
$medium =~ s/.*\///; # basename
# make sure ismedium is set in the binary
Expand Down

0 comments on commit aa5dd4f

Please sign in to comment.