Skip to content
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

license_expression for 'ASL 2.0' is unknown #1731

Open
qduanmu opened this issue Sep 18, 2019 · 1 comment
Open

license_expression for 'ASL 2.0' is unknown #1731

qduanmu opened this issue Sep 18, 2019 · 1 comment

Comments

@qduanmu
Copy link
Contributor

qduanmu commented Sep 18, 2019

Description

Declared license in rpm spec is License: ASL 2.0, and scancode failed to get the correct license expression.

>>> from packagedcode.models import compute_normalized_license
>>> compute_normalized_license('ASL 2.0')
'unknown'

After adding a license rule with 'ASL 2.0' as rule text for 'apache-2.0', reindexed icenses, the license expression could be recognized correctly.

>>> compute_normalized_license('ASL 2.0')
'apache-2.0'

Same issue for 'ASL 1.1', 'ASL 1.0'.

System configuration

For bug reports, it really helps us to know:

  • What OS are you running on? Linux (f29)
  • What version of scancode-toolkit was used to generate the scan file? ScanCode version 3.1.1
  • What installation method was used to install/run scancode? (pip/source download/other)? pip
@pombredanne
Copy link
Contributor

@qduanmu good catch.
There are two different ways we could consider to fix this:

  1. as you suggested we could add rules, with the risk that some of these are are very short and lead to some false positive when found in another context (e.g. not in an RPM metadata)
  2. alternatively, we could add a new type of license detection "matchers" that would be specific to each package type and could be as simple as a mapping for RPMs, mapping each known license declarations used in RPMs to an actual license expression.. (this could be smart and be distro-specific too)

@pombredanne pombredanne added this to the v3.2 milestone Oct 16, 2019
pombredanne added a commit that referenced this issue Nov 17, 2020
ASL 2.0 1.1 and 1.0 ae short references that should be detected.

Reported-by: Qingmin Duanmu <qduanmu@redhat.com>
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
@pombredanne pombredanne removed this from the v3.3 milestone Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants