package-metadata: add CPE information to JSON package manifests
authorPetr Štetiar <ynezz@true.cz>
Wed, 19 Oct 2022 13:46:45 +0000 (15:46 +0200)
committerPetr Štetiar <ynezz@true.cz>
Thu, 2 Nov 2023 14:44:45 +0000 (14:44 +0000)
Common Platform Enumeration (CPE) is a structured naming scheme for
information technology systems, software, and packages.

In order for the information to be processed further, it should also be
available in JSON package manifests.

Signed-off-by: Petr Štetiar <ynezz@true.cz>
(cherry picked from commit 8562c65ff8aae3899cdb190319709500b7651492)

scripts/metadata.pm
scripts/package-metadata.pl

index ee5a2945ca71ff57295be64223d80d32cccd321c..e716f75d10221425a81625d3bb5f90d07e7a047b 100644 (file)
@@ -256,6 +256,7 @@ sub parse_package_metadata($) {
                /^Source: \s*(.+)\s*$/ and $pkg->{source} = $1;
                /^License: \s*(.+)\s*$/ and $pkg->{license} = $1;
                /^LicenseFiles: \s*(.+)\s*$/ and $pkg->{licensefiles} = $1;
+               /^CPE-ID: \s*(.+)\s*$/ and $pkg->{cpe_id} = $1;
                /^Default: \s*(.+)\s*$/ and $pkg->{default} = $1;
                /^Provides: \s*(.+)\s*$/ and do {
                        my @vpkg = split /\s+/, $1;
index 6288584d65f58890bcdfa3f5d359c42672712ee6..dfb280045314388c9f26c37915b594e34b3d0c9c 100755 (executable)
@@ -609,6 +609,7 @@ ${json}{
 "version":"$pkg->{version}",
 "category":"$pkg->{category}",
 "license":"$pkg->{license}",
+"cpe_id":"$pkg->{cpe_id}",
 "maintainer": [$pkg_maintainer],
 "depends":[$pkg_deps]},
 END_JSON