SHA256
1
0
forked from pool/rpmlint
rpmlint/invalid-filerequires.diff
Dirk Mueller 3073721c60 - update to 1.4:
* rpmdiff: Teach rpmdiff about pretrans and posttrans
  * SpecCheck.py: merge patch from #97, using BuildArch with
  something else than Noarch is likely a error and causing issues.
  * FilesCheck.py: Add Python 3.3 magic number
  * FilesCheck.py, InitScriptCheck.py, MenuCheck.py, Pkg.py,
    PostCheck.py: Prepare for rpm-python possibly returning script
   progs as arrays.

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=133
2012-09-13 16:01:40 +00:00

36 lines
1.7 KiB
Diff

Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -421,6 +421,7 @@ invalid_version_regex = re.compile('([0-
# () 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$)')
use_epoch = Config.getOption('UseEpoch', False)
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
max_line_len = Config.getOption('MaxLineLength', 79)
@@ -603,6 +604,9 @@ class TagsCheck(AbstractCheck.AbstractCh
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 and \
FilesCheck.devel_regex.search(d[0]):
printError(pkg, 'devel-dependency', d[0])
@@ -1089,6 +1093,12 @@ explicit Requires: tags.''',
'''This package provides 2 times the same capacity. It should only provide it
once.''',
+'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.''',