Skip to content

Commit e92d083

Browse files
authored
Merge pull request #166 from nokia/add-recursive-option
Add --recursive option
2 parents d90e92d + 02cc0ea commit e92d083

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

tools/openchain_telco_sbom_validator/src/openchain_telco_sbom_validator/cli.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/python3
22

3-
# © 2024 Nokia
3+
# © 2024-2025 Nokia
44
# Authors: Gergely Csatári, Marc-Etienne Vargenau
55
# Licensed under the Apache License 2.0
66
# SPDX-License-Identifier: Apache-2.0
@@ -43,6 +43,9 @@ def main():
4343
filePath = str(args.input)
4444
validator = Validator()
4545

46+
if args.recursive:
47+
args.reference_logic = "checksum-all"
48+
4649
reference_logic = args.reference_logic
4750
if None == args.reference_logic:
4851
reference_logic = "none"
@@ -88,7 +91,8 @@ def parseArguments(additionalArguments: AdditionalArguments = AdditionalArgument
8891
parser.add_argument('input',
8992
help='The input SPDX file.',
9093
nargs="?")
91-
parser.add_argument('--version', action="store_true",
94+
95+
parser.add_argument('-v', '--version', action="store_true",
9296
help='Prints version and exits.',
9397
required=False)
9498
parser.add_argument('--debug', action="store_true",
@@ -106,6 +110,8 @@ def parseArguments(additionalArguments: AdditionalArguments = AdditionalArgument
106110
' The default behaviour is to run a non-strict URL check, meaning that'
107111
' it is not checked if the URL points to a valid page. Strict URL check'
108112
' requires access to the internet and takes some time.')
113+
parser.add_argument('-r', '--recursive', action="store_true",
114+
help='Validate recursively. Same as “--reference-logic checksum-all”.')
109115
parser.add_argument('--reference-logic',
110116
help='Defines the logic how the referenced files are accessible. If not'
111117
' added, the referenced files will not be investigated.'

tools/openchain_telco_sbom_validator/src/openchain_telco_sbom_validator/reporter.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
#!/bin/python3
2+
3+
# © 2024-2025 Nokia
4+
# Authors: Gergely Csatári, Marc-Etienne Vargenau
5+
# Licensed under the Apache License 2.0
6+
# SPDX-License-Identifier: Apache-2.0
7+
18
from prettytable import PrettyTable
29
import shutil
310
from importlib.metadata import version, PackageNotFoundError

tools/openchain_telco_sbom_validator/src/openchain_telco_sbom_validator/validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/python3
22

3-
# © 2024 Nokia
3+
# © 2024-2025 Nokia
44
# Authors: Gergely Csatári, Marc-Etienne Vargenau
55
# Licensed under the Apache License 2.0
66
# SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)