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

TagsCheck: handle license exception in grouping #1014

Merged

Conversation

tmzullinger
Copy link
Contributor

A valid license exception which is in a grouping is reported as invalid. This is due to the trailing ')' being included in the regex. The following license:

(GPL-2.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0) AND MIT

returns:

W: invalid-license-exception Qt-GPL-exception-1.0)

Adjust the license_exception_regex to exclude trailing parenthesis.

Fixes: https://bugzilla.redhat.com/2175241

A valid license exception which is in a grouping is reported as invalid.
This is due to the trailing ')' being included in the regex.  The
following license:

    (GPL-2.0-only OR GPL-3.0-only WITH Qt-GPL-exception-1.0) AND MIT

returns:

    W: invalid-license-exception Qt-GPL-exception-1.0)

Adjust the license_exception_regex to exclude trailing parenthesis.

Fixes: https://bugzilla.redhat.com/2175241
@tmzullinger
Copy link
Contributor Author

I'm not terribly familiar with writing tests for rpmlint, so please let me know if the added test should be adjusted.

Copy link
Member

@danigm danigm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

Copy link
Contributor

@marxin marxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please provide a spec file you used for valid-exception-in-grouping-1.0-1.src.rpm? I would like to upload it to the currently used repository: https://build.opensuse.org/project/show/devel:openSUSE:Factory:rpmlint:tests

@marxin
Copy link
Contributor

marxin commented Mar 6, 2023

Apart from that, I'm fine with the change.

@tmzullinger
Copy link
Contributor Author

Sure, I extracted it from the src.rpm which is part of the change. I used an source instead of a binary rpm to ensure it could be easily reproduced and/or extracted. :)

valid-exception-in-grouping.spec.txt (it has a .txt extension because GitHub is dumb.)

Thanks @danigm and @marxin!

@marxin marxin merged commit baf5da0 into rpm-software-management:main Mar 6, 2023
11 checks passed
@marxin
Copy link
Contributor

marxin commented Mar 6, 2023

Thank you @tmzullinger!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants