spdx / Spdx-Java-Library

Java library which implements the Java object model for SPDX and provides useful helper functions
Apache License 2.0
32 stars 33 forks source link

LicenseCompareHelper: GPL-2.0 license text not recognised #217

Closed sdheh closed 6 months ago

sdheh commented 7 months ago

License text: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt Emoji represent whether this result is expected or not.

Results: matchingStandardLicenseIdsWithinText -> empty list ❌ matchingStandardLicenseIds -> empty list ❌ isTextStandardLicense with GPL-2.0, GPL-2.0-only or GPL-2.0-or-later -> Additional text found after the end of the expected license text starting at line #280 column #21 "end" ❌

Results when excluding optional end (keep lines 1-278): matchingStandardLicenseIdsWithinText -> empty list ❌ matchingStandardLicenseIds -> GPL-2.0, GPL-2.0-only or GPL-2.0-or-later ✅ isTextStandardLicense with GPL-2.0, GPL-2.0-only or GPL-2.0-or-later -> No difference found ✅

I also checked the difference between the optional text in the end of the GPL-2.0 license xml template and the license text using a diff tool and didn't find any difference.

Note: tested using version 1.1.8

goneall commented 6 months ago

I suspect this is also related to the pattern .{0,36000} failing as documented in #214 Once we have a fix for that, I'll test to see if this is resolved.

goneall commented 6 months ago

Fixed with PR #221