mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-19 21:58:04 +00:00
build: fix version info in cyclonedx sbom
Priore8725a932e
, version used to be VERSION:=$(PKG_VERSION)-$(PKG_RELEASE) Aftere8725a932e
, the version is: VERSION:=$(PKG_VERSION)-r$(PKG_RELEASE) Hence the gen_*_cyclonedxsbom functions need to be updated to remove the trailing -r prefix in the version in order to generate correct version info in the SBOM. Signed-off-by: Akshay Bhat <nodeax@gmail.com>
This commit is contained in:
parent
85f6f88223
commit
d8939ff2d5
@ -722,7 +722,7 @@ sub gen_image_cyclonedxsbom() {
|
||||
if ($image_packages{$name}) {
|
||||
$version = $image_packages{$name};
|
||||
}
|
||||
$version =~ s/-\d+$// if $version;
|
||||
$version =~ s/-r\d+$// if $version;
|
||||
if ($name =~ /^(kernel|kmod-)/ and $version =~ /^(\d+\.\d+\.\d+)/) {
|
||||
$version = $1;
|
||||
}
|
||||
@ -775,7 +775,7 @@ sub gen_package_cyclonedxsbom() {
|
||||
}
|
||||
|
||||
my $version = $pkg->{version};
|
||||
$version =~ s/-\d+$// if $version;
|
||||
$version =~ s/-r\d+$// if $version;
|
||||
if ($name =~ /^(kernel|kmod-)/ and $version =~ /^(\d+\.\d+\.\d+)/) {
|
||||
$version = $1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user