- suse-spdx-license-exceptions.patch, suse-sysv-init-checks.diff:

adjust to match rpmlint-tests again

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=387
This commit is contained in:
Dirk Mueller 2016-05-19 19:49:57 +00:00 committed by Git OBS Bridge
parent 5739b595b1
commit bc18f6b179
3 changed files with 27 additions and 31 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu May 19 19:49:25 UTC 2016 - dmueller@suse.com
- suse-spdx-license-exceptions.patch, suse-sysv-init-checks.diff:
adjust to match rpmlint-tests again
-------------------------------------------------------------------
Thu May 19 19:11:40 UTC 2016 - dmueller@suse.com

View File

@ -1,19 +1,19 @@
From 7e1975e3a3d627e316b99a87580808499d9cb9c3 Mon Sep 17 00:00:00 2001
From a7e8eca225a09c08742627af7b0c9bc7db9f44b3 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Wed, 6 Apr 2016 11:29:40 +0200
Subject: [PATCH] Handle SPDX style license exceptions
---
TagsCheck.py | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 54 insertions(+), 5 deletions(-)
TagsCheck.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
Index: rpmlint-1.5/TagsCheck.py
===================================================================
--- rpmlint-1.5.orig/TagsCheck.py
+++ rpmlint-1.5/TagsCheck.py
diff --git a/TagsCheck.py b/TagsCheck.py
index f5b7516..ada84f7 100644
--- a/TagsCheck.py
+++ b/TagsCheck.py
@@ -139,6 +139,34 @@ DEFAULT_VALID_LICENSES = (
'Shareware',
)
)
+DEFAULT_VALID_LICENSE_EXCEPTIONS = (
+ '389-exception',
@ -46,15 +46,15 @@ Index: rpmlint-1.5/TagsCheck.py
BAD_WORDS = {
'alot': 'a lot',
'accesnt': 'accent',
@@ -403,6 +431,7 @@ VALID_GROUPS = Config.getOption('ValidGr
if VALID_GROUPS is None: # get defaults from rpm package only if it's not set
@@ -404,6 +432,7 @@ VALID_GROUPS = Config.getOption('ValidGroups', None)
if VALID_GROUPS is None: # get defaults from rpm package only if it's not set
VALID_GROUPS = Pkg.get_default_valid_rpmgroups()
VALID_LICENSES = Config.getOption('ValidLicenses', DEFAULT_VALID_LICENSES)
+VALID_LICENSE_EXCEPTIONS = Config.getOption('ValidLicenseExceptions', DEFAULT_VALID_LICENSE_EXCEPTIONS)
INVALID_REQUIRES = map(re.compile, Config.getOption('InvalidRequires', DEFAULT_INVALID_REQUIRES))
packager_regex = re.compile(Config.getOption('Packager'))
changelog_version_regex = re.compile('[^>]([^ >]+)\s*$')
@@ -416,6 +445,7 @@ invalid_url_regex = re.compile(Config.ge
@@ -417,6 +446,7 @@ invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE)
lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE)
leading_space_regex = re.compile('^\s+')
license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s')
@ -62,7 +62,7 @@ Index: rpmlint-1.5/TagsCheck.py
invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
# () are here for grouping purpose in the regexp
forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE)
@@ -761,6 +791,10 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -776,6 +806,10 @@ class TagsCheck(AbstractCheck.AbstractCheck):
# printWarning(pkg, 'package-provides-itself')
# break
@ -73,12 +73,9 @@ Index: rpmlint-1.5/TagsCheck.py
def split_license(license):
return (x.strip() for x in
(l for l in license_regex.split(license) if l))
@@ -769,16 +803,26 @@ class TagsCheck(AbstractCheck.AbstractCh
if not rpm_license:
printError(pkg, 'no-license')
@@ -786,7 +820,17 @@ class TagsCheck(AbstractCheck.AbstractCheck):
else:
- valid_license = True
+ invalid_license_part = None
valid_license = True
if rpm_license not in VALID_LICENSES:
- for l1 in split_license(rpm_license):
+ license_string = rpm_license
@ -89,23 +86,13 @@ Index: rpmlint-1.5/TagsCheck.py
+ license_string = l1
+ if lexception not in VALID_LICENSE_EXCEPTIONS:
+ printWarning(pkg, 'invalid-license-exception', lexception)
+ invalid_license_part = rpm_license
+ valid_license = False
+
+ for l1 in split_license(license_string):
if l1 in VALID_LICENSES:
continue
for l2 in split_license(l1):
if l2 not in VALID_LICENSES:
- printWarning(pkg, 'invalid-license', l2)
- valid_license = False
- if not valid_license:
+ invalid_license_part = l2
+ if invalid_license_part:
+ printWarning(pkg, 'invalid-license', invalid_license_part)
self._unexpanded_macros(pkg, 'License', rpm_license)
for tag in ('URL', 'BugURL'):
@@ -1044,6 +1088,11 @@ your specfile.''',
@@ -1062,6 +1106,11 @@ your specfile.''',
'''The value of the License tag was not recognized. Known values are:
"%s".''' % '", "'.join(VALID_LICENSES),
@ -117,3 +104,6 @@ Index: rpmlint-1.5/TagsCheck.py
'obsolete-not-provided',
'''If a package is obsoleted by a compatible replacement, the obsoleted package
should also be provided in order to not cause unnecessary dependency breakage.
--
2.7.4

View File

@ -16,8 +16,8 @@ index f9b13a1..f81a450 100644
'Default-Stop', 'Short-Description')
+suse = True
+stop_on_removal_regex=re.compile('bin/systemctl stop \$service >/dev/null')
+restart_on_update_regex=re.compile('bin/systemctl try-restart \$service >/dev/null')
+stop_on_removal_regex=re.compile('test \"\$DISABLE_STOP_ON_REMOVAL')
+restart_on_update_regex=re.compile('test \"\$DISABLE_RESTART_ON_UPDATE\"')
+insserv_cleanup_regex=re.compile('^\s*/sbin/insserv /etc/init.d$', re.MULTILINE)
class InitScriptCheck(AbstractCheck.AbstractCheck):