2015-04-10 16:35:46 +02:00
|
|
|
From: Some One <nobody@opensuse.org>
|
|
|
|
Date: Thu, 9 Apr 2015 14:55:40 +0200
|
|
|
|
Subject: [PATCH] invalid-filerequires.diff
|
|
|
|
|
2011-04-21 12:12:02 +02:00
|
|
|
===================================================================
|
2015-04-10 16:35:46 +02:00
|
|
|
---
|
|
|
|
TagsCheck.py | 10 ++++++++++
|
|
|
|
1 file changed, 10 insertions(+)
|
|
|
|
|
|
|
|
diff --git a/TagsCheck.py b/TagsCheck.py
|
2015-11-26 11:24:13 +01:00
|
|
|
index 9856f9e..8071f1d 100644
|
2015-04-10 16:35:46 +02:00
|
|
|
--- a/TagsCheck.py
|
|
|
|
+++ b/TagsCheck.py
|
|
|
|
@@ -422,6 +422,7 @@ invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECA
|
2009-08-21 18:19:06 +02:00
|
|
|
# () are here for grouping purpose in the regexp
|
|
|
|
forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE)
|
|
|
|
valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost'))
|
2008-04-17 04:52:37 +02:00
|
|
|
+valid_filedep_regex=re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)')
|
2009-09-16 18:41:21 +02:00
|
|
|
use_epoch = Config.getOption('UseEpoch', False)
|
2009-08-21 18:19:06 +02:00
|
|
|
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
|
2010-10-14 14:32:03 +02:00
|
|
|
max_line_len = Config.getOption('MaxLineLength', 79)
|
2015-04-10 16:35:46 +02:00
|
|
|
@@ -602,6 +603,9 @@ class TagsCheck(AbstractCheck.AbstractCheck):
|
2009-08-21 18:19:06 +02:00
|
|
|
if d[0].startswith('/usr/local/'):
|
|
|
|
printError(pkg, 'invalid-dependency', d[0])
|
2008-04-17 04:52:37 +02:00
|
|
|
|
|
|
|
+ if d[0].startswith('/') and not valid_filedep_regex.search(d[0]):
|
|
|
|
+ printWarning(pkg, 'invalid-filepath-dependency', d[0])
|
|
|
|
+
|
2013-06-28 15:29:34 +02:00
|
|
|
if is_source:
|
|
|
|
if lib_devel_number_regex.search(d[0]):
|
|
|
|
printError(pkg, 'invalid-build-requires', d[0])
|
2015-11-26 11:24:13 +01:00
|
|
|
@@ -1122,6 +1126,12 @@ unneeded explicit Requires: tags.''',
|
2009-09-16 18:41:21 +02:00
|
|
|
'''This package provides 2 times the same capacity. It should only provide it
|
|
|
|
once.''',
|
2008-04-17 04:52:37 +02:00
|
|
|
|
|
|
|
+'invalid-filepath-dependency',
|
2009-08-21 18:19:06 +02:00
|
|
|
+'''A package has a file or path based dependency that is not resolveable for
|
2008-04-17 04:52:37 +02:00
|
|
|
+package solvers because it is not in the whitelist for path based dependencies
|
|
|
|
+and therefore not available in repository metadata. Please use a symbolic requires
|
|
|
|
+instead or require a file in bin or /etc.''',
|
|
|
|
+
|
|
|
|
'tag-not-utf8',
|
|
|
|
'''The character encoding of the value of this tag is not UTF-8.''',
|
|
|
|
|