SHA256
1
0
forked from pool/rpmlint
rpmlint/accept-licenses-with-plus.patch
Dirk Mueller 804a3cc03a Accepting request 875382 from home:coolo:branches:openSUSE:Factory
- Update to version 84.87+git20210226.d6b66e2:
  * GitHub Actions: work around the missing
  * GitHub Actions: work around the missing `groupadd`
  * rclink2: fix test reference output
  * polkit: adjust polkit frobnicate action name

- Add accept-licenses-with-plus.patch to accept any license ending
  with a + (as indicated in the SPDX syntax)

- Remove licenses ending with + from valid license array

OBS-URL: https://build.opensuse.org/request/show/875382
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=768
2021-03-01 19:27:04 +00:00

39 lines
1.6 KiB
Diff

Index: rpmlint-rpmlint-1.11/TagsCheck.py
===================================================================
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
+++ rpmlint-rpmlint-1.11/TagsCheck.py
@@ -845,12 +845,19 @@ class TagsCheck(AbstractCheck.AbstractCh
return (x.strip() for x in
(l for l in license_regex.split(license) if l))
+ def is_valid_license(license):
+ if license in VALID_LICENSES:
+ return True
+ if license.endswith('+'):
+ return license[:-1] in VALID_LICENSES
+ return False
+
rpm_license = pkg[rpm.RPMTAG_LICENSE]
if not rpm_license:
printError(pkg, 'no-license')
else:
valid_license = True
- if rpm_license not in VALID_LICENSES:
+ if not is_valid_license(rpm_license):
license_string = rpm_license
l1, lexception = split_license_exception(rpm_license)
@@ -862,10 +869,10 @@ class TagsCheck(AbstractCheck.AbstractCh
valid_license = False
for l1 in split_license(license_string):
- if l1 in VALID_LICENSES:
+ if is_valid_license(l1):
continue
for l2 in split_license(l1):
- if l2 not in VALID_LICENSES:
+ if not is_valid_license(l2):
printWarning(pkg, 'invalid-license', l2)
valid_license = False
if not valid_license: