anthonyharrison / distro2SBOM

Generates SBOM files from system packaging information
Apache License 2.0
10 stars 7 forks source link

DpkgBuilder: Using input-file does not work #9

Closed mLuca closed 7 months ago

mLuca commented 7 months ago

Example command:

distro2sbom --distro deb --name bullseye --release 11 --input-file myFile --sbom cyclonedx --format json

Output:

Traceback (most recent call last):
  File "/usr/local/bin/distro2sbom", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/distro2sbom/cli.py", line 216, in main
    sbom_build.parse_data(args["input_file"])
  File "/usr/local/lib/python3.9/dist-packages/distro2sbom/distrobuilder/dpkgbuilder.py", line 45, in parse_data
    if self.system_data.get("id") is not None:
AttributeError: 'DpkgBuilder' object has no attribute 'system_data'

Reason:

self.system_data in DpkgBuilder is only created in init if name and release were not given.

Yet, by using "--input-file" the CLI forces the user to give both name and release.