Copy from Base:System/rpmlint based on submit request 17759 from user thomasbiege OBS-URL: https://build.opensuse.org/request/show/17759 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/rpmlint?expand=0&rev=43
34 lines
1.5 KiB
Diff
34 lines
1.5 KiB
Diff
--- TagsCheck.py
|
|
+++ TagsCheck.py
|
|
@@ -402,6 +402,7 @@
|
|
# () 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'))
|
|
+valid_filedep_regex=re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)')
|
|
epoch_regex = re.compile('^[0-9]+:')
|
|
use_epoch = Config.getOption('UseEpoch', 0)
|
|
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
|
|
@@ -484,6 +485,9 @@
|
|
if d[0].startswith('/usr/local/'):
|
|
printError(pkg, 'invalid-dependency', d[0])
|
|
|
|
+ if d[0].startswith('/') and not valid_filedep_regex.search(d[0]):
|
|
+ printWarning(pkg, 'invalid-filepath-dependency', d[0])
|
|
+
|
|
if not devel_depend and not is_devel and not is_source:
|
|
if FilesCheck.devel_regex.search(d[0]):
|
|
printError(pkg, 'devel-dependency', d[0])
|
|
@@ -885,6 +889,12 @@
|
|
'obsolete-on-name',
|
|
'''A package should not obsolete itself, as it can cause weird errors in tools.''',
|
|
|
|
+'invalid-filepath-dependency',
|
|
+'''A package has a file or path based dependency that is not resolveable for
|
|
+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.''',
|
|
|