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

apache-2.0 license detected for a lgpl license text #285

Closed
balusarakesh opened this issue Jul 29, 2016 · 10 comments
Closed

apache-2.0 license detected for a lgpl license text #285

balusarakesh opened this issue Jul 29, 2016 · 10 comments

Comments

@balusarakesh
Copy link
Collaborator

file: pom.xml.txt

<license>
        <name>GNU Lesser General Public License, version 2.1</name>
        <url>http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt</url>
        <distribution>repo</distribution>

when the above file is scanned for licenses using the branch #86 apache-2.0 is detected instead of lgpl-2.1 license.
But when the same file is scanned with the branch develop an lgpl-2.0-plus license is detected.

@pombredanne
Copy link
Member

Good catch. Can you add a test in the #86 branch ?

pombredanne added a commit that referenced this issue Jul 29, 2016
@pombredanne
Copy link
Member

I added new rules too that should fix this

@balusarakesh
Copy link
Collaborator Author

@pombredanne I think the primary goal should be to delete the wrong rule...right?

@pombredanne
Copy link
Member

nope, the primary is to ensure things are detected correctly. The rules in the #86 branch are rather different than in develop

@pombredanne
Copy link
Member

The Apache rule detected is a 50% match with Apache License Version 2 http://www.apache.org/licenses/LICENSE-2.0 from rule apache-2.0_15.RULE lines 12 to 15. This rule should not be deleted. There is something in the filtering code or thresholds that should be handled there instead

@balusarakesh
Copy link
Collaborator Author

@pombredanne
I think we must delete the Apache 2.0 rule or use some kind of fix in the license detection because I'm getting both the licenses in the scan results when the #86 is used.

results": [
    {
      "location": "/home/******/pom.xml.txt", 
      "licenses": [
        {
          "key": "lgpl-2.1", 
          "score": 100.0, 
          "short_name": "LGPL 2.1", 
          "category": "Copyleft Limited", 
          "owner": "Free Software Foundation (FSF)", 
          "homepage_url": "http://www.gnu.org/licenses/lgpl-2.1.html", 
          "text_url": "http://www.gnu.org/licenses/lgpl-2.1.txt", 
          "dejacode_url": "https://enterprise.dejacode.com/license_library/Demo/lgpl-2.1/", 
          "spdx_license_key": "LGPL-2.1", 
          "spdx_url": "http://spdx.org/licenses/LGPL-2.1", 
          "start_line": 12, 
          "end_line": 12
        }, 
        {
          "key": "apache-2.0", 
          "score": 50.0, 
          "short_name": "Apache 2.0", 
          "category": "Attribution", 
          "owner": "Apache Software Foundation", 
          "homepage_url": "http://www.apache.org/licenses/", 
          "text_url": "http://www.apache.org/licenses/LICENSE-2.0", 
          "dejacode_url": "https://enterprise.dejacode.com/license_library/Demo/apache-2.0/", 
          "spdx_license_key": "Apache-2.0", 
          "spdx_url": "http://spdx.org/licenses/Apache-2.0", 
          "start_line": 12, 
          "end_line": 15
        }
      ]
    }

@pombredanne
Copy link
Member

as I said above deleting a rule is not the solution here: the problem you found is due to a bug in the code

@balusarakesh
Copy link
Collaborator Author

ok, got it 👍

@pombredanne
Copy link
Member

pombredanne commented Jul 29, 2016

I you want to give it a shot, you can enable tracing flags to True in index.py and match.py to find out when this Apache match is kept rather than filtered out.

@pombredanne
Copy link
Member

This is all fixed and passing develop

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