KAWAHARA-souta / alma-sbom

AlmaLinux OS SBOM data management utility.
GNU General Public License v3.0
0 stars 0 forks source link

KeyError: 'srpm_url' #14

Open KAWAHARA-souta opened 2 months ago

KAWAHARA-souta commented 2 months ago

epel-release-9-2.el9.noarch.rpm のみ(9.2以降のパッケージ範囲)で発生する事象

$ python alma_sbom.py --rpm-package epel-release-9-2.el9.noarch.rpm --file-format spdx-json --output-file dust
Sep 06 10:53:36 alma-sbom: [WARNING] build info are lacking.
Traceback (most recent call last):
  File "/home/khwarizmi/alma-sbom/alma_sbom.py", line 797, in <module>
    cli_main()
  File "/home/khwarizmi/alma-sbom/alma_sbom.py", line 767, in cli_main
    sbom = get_info_about_package(
  File "/home/khwarizmi/alma-sbom/alma_sbom.py", line 467, in get_info_about_package
    result['metadata']['component'] = _get_each_package_component(
  File "/home/khwarizmi/alma-sbom/alma_sbom.py", line 366, in _get_each_package_component
    _add_package_source_info(
  File "/home/khwarizmi/alma-sbom/alma_sbom.py", line 260, in _add_package_source_info
    'value': immudb_metadata['srpm_url'],
KeyError: 'srpm_url'
KAWAHARA-souta commented 2 months ago

upstreamの47にissueを起票

KAWAHARA-souta commented 2 months ago

epel-release-9-2.el9.noarch.rpm のデータ

hash: 43d75cef1156568670423fa1362e03b228d2e8a5cd288875e25d388dbe66cd5f
{
    "Name": "epel-release-9-2.el9.noarch.rpm",
    "Kind": "file",
    "Size": 17228,
    "Hash": "43d75cef1156568670423fa1362e03b228d2e8a5cd288875e25d388dbe66cd5f",
    "Metadata": {
        "arch": "noarch",
        "epoch": "0",
        "name": "epel-release",
        "release": "2.el9",
        "sbom_api": "0.2",
        "source_type": "srpm",
        "sourcerpm": "epel-release-9-2.el9.src.rpm",
        "version": "9"
    },
    "Signer": "sbom_signer_almalinux",
    "Original_timestamp": "0001-01-01T00:00:00Z",
    "timestamp": 1695069679
}

なぜか "source_type" が "srpm" になっている.