From 910e955788426fdea0e4d51e27100e88217c81fa Mon Sep 17 00:00:00 2001 From: Erik Jaegervall Date: Mon, 31 Jul 2023 16:10:11 +0200 Subject: [PATCH] Add BSD-3-Clause to BOM script Fixes #632 --- .../createbom/bomutil/maplicensefile.py | 2 ++ kuksa_databroker/createbom/createbom.py | 5 ++--- .../createbom/licensestore/BSD-3-Clause.txt.gz | Bin 0 -> 37 bytes 3 files changed, 4 insertions(+), 3 deletions(-) create mode 100644 kuksa_databroker/createbom/licensestore/BSD-3-Clause.txt.gz diff --git a/kuksa_databroker/createbom/bomutil/maplicensefile.py b/kuksa_databroker/createbom/bomutil/maplicensefile.py index 439b9ef7b..044f587d1 100644 --- a/kuksa_databroker/createbom/bomutil/maplicensefile.py +++ b/kuksa_databroker/createbom/bomutil/maplicensefile.py @@ -35,4 +35,6 @@ "rustls-webpki": "webpki.LICENSE.txt.gz", # License text taken from https://spdx.org/licenses/0BSD.html "0BSD": "0BSD.txt.gz", + # License test taken from https://spdx.org/licenses/BSD-3-Clause.html + "BSD-3-Clause": "BSD-3-Clause.txt.gz" } diff --git a/kuksa_databroker/createbom/createbom.py b/kuksa_databroker/createbom/createbom.py index 905a9f030..f704ac0ba 100644 --- a/kuksa_databroker/createbom/createbom.py +++ b/kuksa_databroker/createbom/createbom.py @@ -117,7 +117,7 @@ def generate_bom(source_path, target_path, dashout): errors = [] for crate in crates: try: - print(f"License for {crate['name']}: ", end="") + print(f"License for {crate['name']} {crate['version']}: ", end="") license_filenames = extract_license_filenames(crate) for license_filename in license_filenames: license_files.add(license_filename) @@ -178,7 +178,7 @@ def main(args=None): ) return -2 - if args.dash != None and os.path.exists(args.dash): + if args.dash is not None and os.path.exists(args.dash): print( f"Requested Dash output file {args.dash} exists. Remove it before running this script.") return -3 @@ -195,6 +195,5 @@ def main(args=None): if __name__ == "__main__": - import sys sys.exit(main(sys.argv[1:])) diff --git a/kuksa_databroker/createbom/licensestore/BSD-3-Clause.txt.gz b/kuksa_databroker/createbom/licensestore/BSD-3-Clause.txt.gz new file mode 100644 index 0000000000000000000000000000000000000000..eb4e7256d48e7d8e10be0f93ba302bab8ff474ce GIT binary patch literal 37 mcmb2|=HS?O?05