Skip to content

Commit

Permalink
[backend] already decode the cpeid in the worker
Browse files Browse the repository at this point in the history
This brings the code in sync with the product builder, which
also decodes the cpeid right away.
  • Loading branch information
mlschroe committed Nov 11, 2019
1 parent 7f85aa0 commit 2b9e873
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/backend/bs_worker
Expand Up @@ -2708,11 +2708,9 @@ sub cpeid_from_rpm {
my ($rpm_file) = @_;

my $header = Build::query($rpm_file, "evra" => 1);
if (my ($cpeid) = grep {$_ =~ m/^product-cpeid\(\)/} @{$header->{"provides"}}) {
$cpeid =~ s/.* = //;
# the cpeid is still URL encoded. decoding will happen in publisher
return $cpeid;
}
my ($cpeid) = grep {/^product-cpeid\(\)/} @{$header->{'provides'} || []};
$cpeid =~ s/.* = // if $cpeid;
return $cpeid ? BSHTTP::urldecode($cpeid) : undef;
}

# parse all .report files and create a channel file from them
Expand Down

0 comments on commit 2b9e873

Please sign in to comment.