SHA256
1
0
forked from pool/rpmlint

- add suse-filter-more-verbose.diff:

* make it more obvious which rpmlintrc causes an exception (bnc#801192)

OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=175
This commit is contained in:
Dirk Mueller 2013-02-26 11:08:19 +00:00 committed by Git OBS Bridge
parent 55c4e0b4f3
commit aae8be1227
20 changed files with 87 additions and 28 deletions

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -659,7 +659,7 @@ buildconfig_rpath_regex = re.compile('(?
@@ -654,7 +654,7 @@ buildconfig_rpath_regex = re.compile('(?
sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$')
devel_regex = re.compile('(.*)-(debug(info)?|devel|headers|source|static)$')
debuginfo_package_regex = re.compile('-debug(info)?$')

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1702,7 +1702,10 @@ executed.''',
@@ -1697,7 +1697,10 @@ executed.''',
executed.''',
'wrong-script-interpreter',

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -847,6 +847,10 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -842,6 +842,10 @@ class FilesCheck(AbstractCheck.AbstractC
# Check if the package is a development package
devel_pkg = devel_regex.search(pkg.name)

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -653,6 +653,7 @@ bin_regex = re.compile('^/(?:usr/(?:s?bi
@@ -648,6 +648,7 @@ bin_regex = re.compile('^/(?:usr/(?:s?bi
includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE)
develfile_regex = re.compile('\.(a|cmxa?|mli?)$')
buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$')
@ -10,7 +10,7 @@ Index: FilesCheck.py
# room for improvement with catching more -R, but also for false positives...
buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b')
sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$')
@@ -1204,7 +1205,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1199,7 +1200,7 @@ class FilesCheck(AbstractCheck.AbstractC
includefile_regex.search(f) or \
develfile_regex.search(f) or \
logrotate_regex.search(f)
@ -19,7 +19,7 @@ Index: FilesCheck.py
printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \
f not in ghost_files:
@@ -1576,7 +1577,10 @@ included in your package.''',
@@ -1571,7 +1572,10 @@ included in your package.''',
'spurious-executable-perm',
'''The file is installed with executable permissions, but was identified as one
that probably should not be executable. Verify if the executable bits are

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1222,7 +1222,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1217,7 +1217,7 @@ class FilesCheck(AbstractCheck.AbstractC
if nonexec_file and not docdir_examples_regex.search(f):
printWarning(pkg, 'spurious-executable-perm', f)
elif f.startswith('/etc/') and f not in config_files and \

View File

@ -2,7 +2,7 @@ Index: Filter.py
===================================================================
--- Filter.py.orig
+++ Filter.py
@@ -109,7 +109,7 @@ def printAllReasons():
@@ -112,7 +112,7 @@ def printAllReasons():
if len(last_reason):
printDescriptions(last_reason)
last_reason = reason
@ -15,7 +15,7 @@ Index: rpmlint
===================================================================
--- rpmlint.orig
+++ rpmlint
@@ -211,7 +211,7 @@ def main():
@@ -212,7 +212,7 @@ def main():
% (packages_checked, specfiles_checked,
printed_messages["E"], printed_messages["W"])

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -864,7 +864,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -859,7 +859,7 @@ class FilesCheck(AbstractCheck.AbstractC
debuginfo_srcs = False
debuginfo_debugs = False

View File

@ -1,6 +1,8 @@
--- FilesCheck.py
Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -286,7 +286,7 @@
@@ -753,7 +753,7 @@ def peek(filename, pkg, length=1024):
istext = float(len(t))/len(chunk) <= 0.30
return (chunk, istext)
@ -9,7 +11,7 @@
# the values here.
_python_magic_values = {
'2.2': 60717,
@@ -298,7 +298,7 @@
@@ -765,7 +765,7 @@ _python_magic_values = {
'3.0': 3130,
'3.1': 3150,
'3.2': 3180,

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Tue Feb 26 11:07:12 UTC 2013 - dmueller@suse.com
- add suse-filter-more-verbose.diff:
* make it more obvious which rpmlintrc causes an exception (bnc#801192)
-------------------------------------------------------------------
Mon Feb 18 09:29:48 UTC 2013 - meissner@suse.com

View File

@ -63,6 +63,7 @@ Patch7: suse-pkg-config-check.diff
Patch8: suse-binarieschecks.diff
Patch9: no-doc-for-lib.diff
Patch10: add-scoring-support.diff
Patch11: suse-filter-more-verbose.diff
Patch12: usr-arch.diff
Patch13: script-interpreter-only-for-exec-scripts.diff
Patch14: sourced-dirs.diff
@ -139,6 +140,7 @@ source packages can be checked.
%patch8
%patch9
#%patch10
%patch11
%patch12
%patch13
%patch14

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1254,7 +1254,7 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1249,7 +1249,7 @@ class FilesCheck(AbstractCheck.AbstractC
elif interpreter or mode & 0111 != 0 or \
script_regex.search(f):
if interpreter:

View File

@ -2,7 +2,7 @@ Index: TagsCheck.py
===================================================================
--- TagsCheck.py.orig
+++ TagsCheck.py
@@ -817,6 +817,7 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -819,6 +819,7 @@ class TagsCheck(AbstractCheck.AbstractCh
obs_names = [x[0] for x in pkg.obsoletes()]
prov_names = [x[0].split(':/')[0] for x in pkg.provides()]
@ -10,7 +10,7 @@ Index: TagsCheck.py
for o in (x for x in obs_names if x not in prov_names):
printWarning(pkg, 'obsolete-not-provided', o)
@@ -828,6 +829,8 @@ class TagsCheck(AbstractCheck.AbstractCh
@@ -830,6 +831,8 @@ class TagsCheck(AbstractCheck.AbstractCh
# https://bugzilla.redhat.com/460872
useless_provides = []
for p in prov_names:
@ -19,7 +19,7 @@ Index: TagsCheck.py
if prov_names.count(p) != 1 and p not in useless_provides:
useless_provides.append(p)
for p in useless_provides:
@@ -968,6 +971,10 @@ the Release tag.''',
@@ -970,6 +973,10 @@ the Release tag.''',
'''There is no Name tag in your package. You have to specify a name using the
Name tag.''',

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -686,7 +686,7 @@ manifest_perl_regex = re.compile('^/usr/
@@ -681,7 +681,7 @@ manifest_perl_regex = re.compile('^/usr/
shebang_regex = re.compile('^#!\s*(\S+)')
interpreter_regex = re.compile('^/(usr/)?(s?bin|games|libexec(/.+)?|(lib(64)?|share)/.+)/[^/]+$')
script_regex = re.compile('^/((usr/)?s?bin|etc/(rc\.d/init\.d|X11/xinit\.d|cron\.(hourly|daily|monthly|weekly)))/')

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1277,7 +1277,8 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1272,7 +1272,8 @@ class FilesCheck(AbstractCheck.AbstractC
f.endswith('.la')):
printError(pkg, 'script-without-shebang', f)

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -953,6 +953,16 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -948,6 +948,16 @@ class FilesCheck(AbstractCheck.AbstractC
if res.group(1) != pkg.name:
printError(pkg, 'incoherent-logrotate-file', f)
@ -19,7 +19,7 @@ Index: FilesCheck.py
if link != '':
ext = compr_regex.search(link)
if ext:
@@ -1762,6 +1772,24 @@ consequences), or other compiler flags w
@@ -1757,6 +1767,24 @@ consequences), or other compiler flags w
extraction not working as expected. Verify that the binaries are not
unexpectedly stripped and that the intended compiler flags are used.''',

View File

@ -0,0 +1,48 @@
--- Config.py
+++ Config.py
@@ -11,6 +11,7 @@
import locale
import os.path
import re
+import sys
try:
from __version__ import __version__
@@ -163,7 +164,17 @@
if '(' in _filters_non_except[idx]:
_non_named_group_re.subn('(:?', _filters_non_except[idx])
_filters_non_except_re = _filters_non_except_re + '|(?:' + _filters_non_except[idx] +')'
- _filters_non_except_re = re.compile(_filters_non_except_re)
+ try:
+ _filters_non_except_re = re.compile(_filters_non_except_re)
+ except Exception:
+ # Try to figure out which filter caused the error
+ for f in _filters_non_except[1:]:
+ try:
+ re.compile(f)
+ except Exception as e:
+ # can't use Pkg.error/warn here, as that would recurse
+ print >> sys.stderr, "(none): E: %s in filter '%s'" % (e.message, f)
+ sys.exit(2)
if _filters_re == None and len(_filters):
_filters_re = '(?:' + _filters[0] + ')'
@@ -175,7 +186,17 @@
if '(' in _filters[idx]:
_non_named_group_re.subn('(:?', _filters[idx])
_filters_re = _filters_re + '|(?:' + _filters[idx] +')'
- _filters_re = re.compile(_filters_re)
+ try:
+ _filters_re = re.compile(_filters_re)
+ except Exception:
+ # Try to figure out which filter caused the error
+ for f in _filters[1:]:
+ try:
+ re.compile(f)
+ except Exception as e:
+ # can't use Pkg.error/warn here, as that would recurse
+ print >> sys.stderr, "(none): E: %s in filter '%s'" % (e.message, f)
+ sys.exit(2)
if _filters_except_re == None and len(_filters_except):
_filters_except_re = '(?:' + _filters_except[0] + ')'

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -651,7 +651,7 @@ points_regex = re.compile('^\.\./(.*)')
@@ -646,7 +646,7 @@ points_regex = re.compile('^\.\./(.*)')
doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help')
bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)')
includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE)

View File

@ -1,7 +1,8 @@
diff -ruN a/FilesCheck.py b/FilesCheck.py
--- a/FilesCheck.py 2011-12-04 17:22:02.000000000 +0100
+++ b/FilesCheck.py 2012-12-07 13:48:46.544507295 +0100
@@ -948,7 +948,7 @@
Index: rpmlint-1.4/FilesCheck.py
===================================================================
--- rpmlint-1.4.orig/FilesCheck.py
+++ rpmlint-1.4/FilesCheck.py
@@ -1434,7 +1434,7 @@ class FilesCheck(AbstractCheck.AbstractC
for exe, paths in bindir_exes.items():
if len(paths) > 1:
printWarning(pkg, "duplicate-executable", exe, paths)

View File

@ -2,7 +2,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -1153,8 +1153,11 @@ class FilesCheck(AbstractCheck.AbstractC
@@ -1148,8 +1148,11 @@ class FilesCheck(AbstractCheck.AbstractC
if res and not (pkg.check_versioned_dep('python-base',
res.group(1)) or
pkg.check_versioned_dep('python',

View File

@ -3,7 +3,7 @@ Index: FilesCheck.py
===================================================================
--- FilesCheck.py.orig
+++ FilesCheck.py
@@ -664,7 +664,7 @@ ldconfig_regex = re.compile('^[^#]*ldcon
@@ -659,7 +659,7 @@ ldconfig_regex = re.compile('^[^#]*ldcon
depmod_regex = re.compile('^[^#]*depmod', re.MULTILINE)
install_info_regex = re.compile('^[^#]*install-info', re.MULTILINE)
perl_temp_file_regex = re.compile('.*perl.*/(\.packlist|perllocal\.pod)$')