Fix typos and add info where to find license-validate
This commit is contained in:
parent
06bf5fc3d1
commit
f2292967e5
@ -14,7 +14,7 @@
|
|||||||
# * run bundled_licenses.py on the binary RPMs to see what is
|
# * run bundled_licenses.py on the binary RPMs to see what is
|
||||||
# bundled in the shipped RPMs
|
# bundled in the shipped RPMs
|
||||||
# * validate the output of bundled_licenses.py
|
# * validate the output of bundled_licenses.py
|
||||||
# * add licenses identiefied in the source code of nodejs itself
|
# * add licenses identified in the source code of nodejs itself
|
||||||
# * validate the resulting License tag suggestion by license-validate tool
|
# * validate the resulting License tag suggestion by license-validate tool
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
@ -63,7 +63,7 @@ def license_from_package_json(file_path):
|
|||||||
return ' AND '.join([parse_license_tag(license) for license in data['licenses']])
|
return ' AND '.join([parse_license_tag(license) for license in data['licenses']])
|
||||||
else:
|
else:
|
||||||
if 'name' in data and 'version' in data:
|
if 'name' in data and 'version' in data:
|
||||||
print(f"Error: Key license not found in {file_path} despite it looks like a valid package.json file")
|
print(f"Error: Key license not found in {file_path} despite it looking like a valid package.json file")
|
||||||
else:
|
else:
|
||||||
print(f"Warning: Key license not found in {file_path} but it might not be a valid package.json file at all")
|
print(f"Warning: Key license not found in {file_path} but it might not be a valid package.json file at all")
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
@ -76,13 +76,13 @@ if __name__ == "__main__":
|
|||||||
parser = argparse.ArgumentParser(description='Find and parse package.json '\
|
parser = argparse.ArgumentParser(description='Find and parse package.json '\
|
||||||
'files in specified directories, and return probable License tag to '\
|
'files in specified directories, and return probable License tag to '\
|
||||||
'be used in an RPM spec file. It is likely better to run it on '\
|
'be used in an RPM spec file. It is likely better to run it on '\
|
||||||
'unpackged or installed RPMs, rather than unpacked source, because '\
|
'unpacked or installed RPMs, rather than unpacked source, because '\
|
||||||
'some of the bundled deps are not likely used in the shipped output. '\
|
'some of the bundled deps are likely not used in the shipped output. '\
|
||||||
'It is always necessary to manually verify the results by investigating '\
|
'It is always necessary to manually verify the results by investigating '\
|
||||||
'the files and the resulting License tag may be verified using '\
|
'the files and the resulting License tag may be verified using '\
|
||||||
'license-validate tool.')
|
'license-validate tool (check license-validate RPM in Fedora) .')
|
||||||
parser.add_argument('directories', nargs='*', default=[os.getcwd()],
|
parser.add_argument('directories', nargs='*', default=[os.getcwd()],
|
||||||
help='Directories to search for package.json files, if no is given, use the current directory.')
|
help='Directories to search for package.json files, if none is given, use the current directory.')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
@ -95,5 +95,5 @@ if __name__ == "__main__":
|
|||||||
licenses.add(fix_known_spdx_issues(l))
|
licenses.add(fix_known_spdx_issues(l))
|
||||||
print(f"OK: License detected in {f}: {l}")
|
print(f"OK: License detected in {f}: {l}")
|
||||||
print('Final license tag to be used in the RPM spec file (please, confirm manually '\
|
print('Final license tag to be used in the RPM spec file (please, confirm manually '\
|
||||||
'buy looking into files and validate using license-validate tool):')
|
'by looking into files and validate using the license-validate tool):')
|
||||||
print('Lincese: ' + ' AND '.join(sorted(licenses)))
|
print('License: ' + ' AND '.join(sorted(licenses)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user