rpmlint icon indicating copy to clipboard operation
rpmlint copied to clipboard

license parsing corner case

Open spotrh opened this issue 3 years ago • 8 comments

I think the license regexes needs some adjustment for a corner case. In Fedora, we have a package pending review (sip6) that has this as a license tag:

License: (GPLv2 or GPLv3) and (GPLv2+ with exceptions)

rpmlint returns:

sip6.src: W: invalid-license-exception exceptions) sip6.src: W: invalid-license (GPLv2+

spotrh avatar Jul 15 '21 17:07 spotrh

Note that rpmlint uses SPDX License List as defined here: https://spdx.org/licenses/. So my guess is that you need something like GPL-2.0-with-autoconf-exception, in your case sip6..

marxin avatar Jul 22 '21 12:07 marxin

Not for Fedora, it doesn't. It still uses the traditional RPM shorthand identifiers.

Conan-Kudo avatar Sep 02 '21 13:09 Conan-Kudo

Not for Fedora, it doesn't. It still uses the traditional RPM shorthand identifiers.

What do you suggest for the mentioned license (License: (GPLv2 or GPLv3) and (GPLv2+ with exceptions)) ? What can we do?

marxin avatar Sep 02 '21 14:09 marxin

I'm not sure. I think we're probably not handling whitespace in the field properly.

Conan-Kudo avatar Sep 02 '21 14:09 Conan-Kudo

Oh, you are right, I haven't noticed the split error messages.

marxin avatar Sep 02 '21 14:09 marxin

I can confirm the parsing can be improved to the following tokens: GPLv2, GPLv3 and GPLv2+ (+ exception=exceptions). Anyway, I'm not planning to work on that right now..

marxin avatar Sep 03 '21 06:09 marxin

I have closed #769 as this is the ticket I need to track

smooge avatar Dec 13 '21 12:12 smooge