2015-04-10 16:35:46 +02:00
|
|
|
From: Some One <nobody@opensuse.org>
|
|
|
|
Date: Thu, 9 Apr 2015 14:55:37 +0200
|
|
|
|
Subject: [PATCH] suse-version.diff
|
|
|
|
|
2013-06-28 15:29:34 +02:00
|
|
|
===================================================================
|
2015-04-10 16:35:46 +02:00
|
|
|
---
|
|
|
|
SpecCheck.py | 16 ++++++++++++++++
|
|
|
|
1 file changed, 16 insertions(+)
|
|
|
|
|
2019-01-13 15:33:18 +01:00
|
|
|
Index: rpmlint-rpmlint-1.11/SpecCheck.py
|
2017-09-28 13:35:09 +02:00
|
|
|
===================================================================
|
2019-01-13 15:33:18 +01:00
|
|
|
--- rpmlint-rpmlint-1.11.orig/SpecCheck.py
|
|
|
|
+++ rpmlint-rpmlint-1.11/SpecCheck.py
|
|
|
|
@@ -49,6 +49,7 @@ packager_regex = re_tag_compile('Package
|
2017-09-28 13:35:09 +02:00
|
|
|
buildarch_regex = re_tag_compile('BuildArch(?:itectures)?')
|
|
|
|
buildprereq_regex = re_tag_compile('BuildPreReq')
|
|
|
|
prereq_regex = re_tag_compile(r'PreReq(\(.*\))')
|
2017-09-30 10:27:35 +02:00
|
|
|
+suse_version_regex = re.compile(r'%suse_version\s*[<>=]+\s*(\d+)')
|
2017-09-28 13:35:09 +02:00
|
|
|
|
|
|
|
make_check_regex = re.compile(r'(^|\s|%{?__)make}?\s+(check|test)')
|
|
|
|
rm_regex = re.compile(r'(^|\s)((.*/)?rm|%{?__rm}?) ')
|
2019-01-13 15:33:18 +01:00
|
|
|
@@ -389,6 +390,12 @@ class SpecCheck(AbstractCheck.AbstractCh
|
2012-09-13 18:01:40 +02:00
|
|
|
if not res.group(1).startswith('%'):
|
|
|
|
printWarning(pkg, 'hardcoded-prefix-tag', res.group(1))
|
2008-04-17 04:52:37 +02:00
|
|
|
|
2009-03-13 16:06:45 +01:00
|
|
|
+ res = suse_version_regex.search(line)
|
2017-01-02 15:29:36 +01:00
|
|
|
+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1315:
|
2009-03-13 16:06:45 +01:00
|
|
|
+ printWarning(pkg, "obsolete-suse-version-check", res.group(1))
|
2018-08-08 10:34:58 +02:00
|
|
|
+ elif res and int(res.group(1)) > 1550:
|
2009-03-13 16:06:45 +01:00
|
|
|
+ printError(pkg, "invalid-suse-version-check", res.group(1))
|
2008-04-17 04:52:37 +02:00
|
|
|
+
|
2009-03-13 16:06:45 +01:00
|
|
|
res = prereq_regex.search(line)
|
|
|
|
if res:
|
|
|
|
printError(pkg, 'prereq-use', res.group(2))
|
2017-09-28 13:35:09 +02:00
|
|
|
@@ -806,6 +813,15 @@ architecture independent or if some othe
|
|
|
|
in some editors but can lead to obscure errors. It should be replaced by a
|
|
|
|
regular space.''',
|
2009-08-21 18:19:06 +02:00
|
|
|
|
2008-04-17 04:52:37 +02:00
|
|
|
+'obsolete-suse-version-check',
|
|
|
|
+'''The specfile contains a comparison of %suse_version against a suse release
|
|
|
|
+that is no longer in maintenance. Consider removing obsolete parts of your
|
|
|
|
+spec file to make it more readable.''',
|
|
|
|
+
|
|
|
|
+'invalid-suse-version-check',
|
|
|
|
+'''The specfile contains a comparison of %suse_version against a suse release
|
2009-08-21 18:19:06 +02:00
|
|
|
+that does not exist. Please double check.''',
|
2008-06-25 19:08:32 +02:00
|
|
|
+
|
2009-08-21 18:19:06 +02:00
|
|
|
'non-standard-group',
|
|
|
|
'''The value of the Group tag in the package is not valid. Valid groups are:
|
|
|
|
"%s".''' % '", "'.join(VALID_GROUPS),
|