spdx / tools

SPDX Tools
Apache License 2.0
127 stars 69 forks source link

Copyright sign in GPL-3.0 does not match all instances #260

Closed spoenemann closed 3 years ago

spoenemann commented 4 years ago

The current license template of GPL-3.0 contains the line

Copyright © 2007 Free Software Foundation, Inc.

However, the copyright sign © is represented as (C) in many instances of the license found in the wild. The template should be able to match both variants.

zvr commented 4 years ago

It does, by means of the Matching Guidelines (https://spdx.github.io/spdx-spec/appendix-II-license-matching-guidelines-and-templates/#9-copyright-symbol) which explicitly say:

"©", "(c)", or "Copyright" should be considered equivalent and interchangeable.

spoenemann commented 4 years ago

What about an uppercase C, as in (C)?

goneall commented 4 years ago

What about an uppercase C, as in (C)?

This is covered by Matching Guidelines section 4:

All upper case and lower case letters should be treated as lower case letters. Templates do not include markup for this guideline.

goneall commented 4 years ago

Note that many of the guidelines are not implemented in the templates themselves, but are implemented in tools which support the license matching guidelines.

There are now 3 tools that compare license text using the matching guidelines and text:

spoenemann commented 3 years ago

I'm using the Java library to detect licenses with LicenseCompareHelper here:

https://github.com/eclipse/openvsx/blob/37288e214643c943423b29c55258899e36375460/server/src/main/java/org/eclipse/openvsx/util/LicenseDetection.java#L65

I have a unit test that tries to detect this license text, which starts with Copyright (C):

https://github.com/eclipse/openvsx/blob/master/server/src/test/resources/org/eclipse/openvsx/util/GPL-3.0.txt

The test fails with the license template obtained via spdx-tools. I made a slight change in line 5 to make the test pass:

https://github.com/eclipse/openvsx/blob/master/server/src/main/resources/spdx-templates/GPL-3.0.txt

So it seems to me that the matching guidelines are not fully implemented in this case.

goneall commented 3 years ago

@spoenemann Thanks for the detailed description and unit test reference. The Java matching tools should be normalizing the copyright and case. I'll look into the code over the weekend and see if I can find out why it isn't matching.

goneall commented 3 years ago

I found the issue in the SPDX java tools - transferring to the tools repo

goneall commented 3 years ago

@spoenemann Finally got this resolved in PR #261 - if you pull the latest code, it should now work.

Let me know if you want me to spin out a new release to Maven Central and Bintray

spoenemann commented 3 years ago

Great! It would be good to have this in a release at some time, but it's not urgent as we have a workaround.

goneall commented 3 years ago

Resolved in release 2.2.4