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(+)
|
|
|
|
|
|
|
|
diff --git a/SpecCheck.py b/SpecCheck.py
|
2015-11-26 11:24:13 +01:00
|
|
|
index b69bead..2e3ba56 100644
|
2015-04-10 16:35:46 +02:00
|
|
|
--- a/SpecCheck.py
|
|
|
|
+++ b/SpecCheck.py
|
2015-11-26 11:24:13 +01:00
|
|
|
@@ -67,6 +67,7 @@ libdir_regex = re.compile('%{?_lib(?:dir)?\}?\\b')
|
2008-06-25 19:08:32 +02:00
|
|
|
comment_or_empty_regex = re.compile('^\s*(#|$)')
|
|
|
|
defattr_regex = re.compile('^\s*%defattr\\b')
|
|
|
|
attr_regex = re.compile('^\s*%attr\\b')
|
2008-04-17 04:52:37 +02:00
|
|
|
+suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)')
|
2009-08-21 18:19:06 +02:00
|
|
|
section_regexs = dict(
|
|
|
|
([x, re.compile('^%' + x + '(?:\s|$)')]
|
2015-04-10 16:35:46 +02:00
|
|
|
for x in ('build', 'changelog', 'check', 'clean', 'description', 'files',
|
2015-11-26 11:24:13 +01:00
|
|
|
@@ -388,6 +389,12 @@ class SpecCheck(AbstractCheck.AbstractCheck):
|
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)
|
2013-09-23 16:39:33 +02:00
|
|
|
+ if res and int(res.group(1)) > 0 and int(res.group(1)) < 1210:
|
2009-03-13 16:06:45 +01:00
|
|
|
+ printWarning(pkg, "obsolete-suse-version-check", res.group(1))
|
2013-09-23 16:39:33 +02:00
|
|
|
+ elif res and int(res.group(1)) > 1310:
|
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))
|
2015-11-26 11:24:13 +01:00
|
|
|
@@ -816,6 +823,15 @@ in the resulting binary package depending on the build environment and rpmbuild
|
2011-05-19 16:19:35 +02:00
|
|
|
version (typically < 4.4). Add default attributes using %defattr before it in
|
|
|
|
the %files section, or use per entry %attr's.''',
|
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),
|