-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In SPDX output, have PackageLicenseDeclared give the license directly instead of creating an unnecessary LicenseRef. #1147
Comments
Thanks for the issue @vargenau. Unfortunately, we can't always use the direct license value as we have no way of checking currently if the license is an approved license on the SPDX license list. Additionally, sometimes licenses that are on the approved license list are not reported using the correct identifier and we would need a way to interpret these causes and augment these licenses to their correct license identifier. Therefore, we have to default to using a LicenseRef currently. Your suggestion would certainly be a good enhancement and we have an issue open for this: #281. There was also talk in the SPDX community a few years ago about creating a license mapping repo but not much work has been done on this yet. I think the repo was created but no commits have been added. |
Hi Rose, The following Python code should be able to do the job: https://pypi.org/project/spdx-lookup/. Are you aware of it? |
I can work on this. |
I was not aware, thank you! We will try to use this. |
Hi, I have found a better SPDX license expression parser: To install it:
Then you have to apply the following patch to file formats/spdx/spdxtagvalue/package_helpers.py
This will produce a PackageLicenseDeclared as proposed above. What remains to do is to remove the now useless LicenseID and ExtractedText that are still generated, I did not find an easy way to do it. Also, the is for the SPDX tag;value format only, I did tot check what needs to be done for the SPDX JSON format. Tell me if this is useful and can be integrated. |
Previously the `PackageLicenseDeclared` and `licenseDeclared` data for spdxtagvalue and spdxjson, respectively, were set to license reference of type LicenseRef-df8cb33 which is not informative. This change updates that data to the actual license info, f.e. MIT, in case a license is declared, or the LicenseRef-df8cb33 value if it's not Resolves #1147 Signed-off-by: Ivana Atanasova <iyovcheva@vmware.com>
Describe the Feature
In SPDX output, have PackageLicenseDeclared give the license directly instead of creating an unnecessary LicenseRef.
Use Cases
It will be easier for tools to process the SPDX files.
Implementation Changes
One would need to be able to identify a license already in SPDX format.
Tern is run with the following command:
danm-cni-plugins.spdx.txt
In the SPDX output file, you have the following:
and
The license here is correctly detected and the name is the one found in the SPDX license list.
So it would be much better to output:
The text was updated successfully, but these errors were encountered: