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>
Wed, 1 Nov 2023 11:14:39 +0000 (11:14 +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>
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 8d8a9fd30659a3c40b7943b5e6fa2af589723f63..e34b738c0f1eea61d75c6c00a1394513d6476a60 100755 (executable)
@@ -611,6 +611,7 @@ ${json}{
 "version":"$pkg->{version}",
 "category":"$pkg->{category}",
 "license":"$pkg->{license}",
+"cpe_id":"$pkg->{cpe_id}",
 "maintainer": [$pkg_maintainer],
 "depends":[$pkg_deps]},
 END_JSON