Compare commits
No commits in common. 'c9' and 'i8c' have entirely different histories.
@ -1 +1 @@
|
|||||||
SOURCES/rpmlint-1.11.tar.gz
|
SOURCES/rpmlint-1.10.tar.gz
|
||||||
|
@ -1 +1 @@
|
|||||||
473ddaabbe28a2f5836116d4b19e4a9b641fd038 SOURCES/rpmlint-1.11.tar.gz
|
d77b498d42d6d7ef044df14a0f37cf88e520cebd SOURCES/rpmlint-1.10.tar.gz
|
||||||
|
@ -0,0 +1,25 @@
|
|||||||
|
diff -up rpmlint-rpmlint-1.10/test.sh.fix_test rpmlint-rpmlint-1.10/test.sh
|
||||||
|
--- rpmlint-rpmlint-1.10/test.sh.fix_test 2017-09-05 08:40:05.000000000 +0200
|
||||||
|
+++ rpmlint-rpmlint-1.10/test.sh 2019-06-13 12:05:03.663871888 +0200
|
||||||
|
@@ -2,7 +2,7 @@
|
||||||
|
|
||||||
|
export PYTHONPATH=$(pwd)/tools:$(pwd)
|
||||||
|
export TESTPATH="$(pwd)/test/"
|
||||||
|
-: ${PYTHON:=python} ${PYTEST:=py.test} ${FLAKE8:=flake8}
|
||||||
|
+: ${PYTHON:=/usr/libexec/platform-python} ${PYTEST:=py.test-3} ${FLAKE8:=flake8}
|
||||||
|
: ${PYTHONWARNINGS:=all}
|
||||||
|
export PYTHONWARNINGS
|
||||||
|
|
||||||
|
@@ -40,9 +40,9 @@ $PYTEST -v || exit $?
|
||||||
|
|
||||||
|
unset PYTHONWARNINGS
|
||||||
|
|
||||||
|
-echo "$FLAKE8 tests"
|
||||||
|
-$FLAKE8 --version
|
||||||
|
-$FLAKE8 . ./rpmdiff ./rpmlint || exit $?
|
||||||
|
+#echo "$FLAKE8 tests"
|
||||||
|
+#$FLAKE8 --version
|
||||||
|
+#$FLAKE8 . ./rpmdiff ./rpmlint || exit $?
|
||||||
|
|
||||||
|
echo "man page tests"
|
||||||
|
if man --help 2>&1 | grep -q -- --warnings; then
|
@ -0,0 +1,358 @@
|
|||||||
|
diff -up rpmlint-rpmlint-1.10/AbstractCheck.py.flake rpmlint-rpmlint-1.10/AbstractCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/AbstractCheck.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/AbstractCheck.py 2018-04-17 12:22:20.681609697 -0400
|
||||||
|
@@ -11,7 +11,7 @@ import contextlib
|
||||||
|
import re
|
||||||
|
try:
|
||||||
|
import urllib2
|
||||||
|
-except:
|
||||||
|
+except ImportError:
|
||||||
|
import urllib.request as urllib2
|
||||||
|
|
||||||
|
import Config
|
||||||
|
diff -up rpmlint-rpmlint-1.10/BinariesCheck.py.flake rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/BinariesCheck.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/BinariesCheck.py 2018-04-17 12:22:52.688880629 -0400
|
||||||
|
@@ -101,32 +101,32 @@ class BinaryInfo(object):
|
||||||
|
('readelf', '-W', '-S', '-l', '-d', '-s', path))
|
||||||
|
if not res[0]:
|
||||||
|
lines = res[1].splitlines()
|
||||||
|
- for l in lines:
|
||||||
|
- r = BinaryInfo.needed_regex.search(l)
|
||||||
|
+ for line in lines:
|
||||||
|
+ r = BinaryInfo.needed_regex.search(line)
|
||||||
|
if r:
|
||||||
|
self.needed.append(r.group(1))
|
||||||
|
continue
|
||||||
|
|
||||||
|
- r = BinaryInfo.rpath_regex.search(l)
|
||||||
|
+ r = BinaryInfo.rpath_regex.search(line)
|
||||||
|
if r:
|
||||||
|
for p in r.group(1).split(':'):
|
||||||
|
self.rpath.append(p)
|
||||||
|
continue
|
||||||
|
|
||||||
|
- if BinaryInfo.comment_regex.search(l):
|
||||||
|
+ if BinaryInfo.comment_regex.search(line):
|
||||||
|
self.comment = True
|
||||||
|
continue
|
||||||
|
|
||||||
|
- if BinaryInfo.pic_regex.search(l):
|
||||||
|
+ if BinaryInfo.pic_regex.search(line):
|
||||||
|
self.non_pic = False
|
||||||
|
continue
|
||||||
|
|
||||||
|
- r = BinaryInfo.soname_regex.search(l)
|
||||||
|
+ r = BinaryInfo.soname_regex.search(line)
|
||||||
|
if r:
|
||||||
|
self.soname = r.group(1)
|
||||||
|
continue
|
||||||
|
|
||||||
|
- r = BinaryInfo.stack_regex.search(l)
|
||||||
|
+ r = BinaryInfo.stack_regex.search(line)
|
||||||
|
if r:
|
||||||
|
self.stack = True
|
||||||
|
flags = r.group(1)
|
||||||
|
@@ -134,45 +134,45 @@ class BinaryInfo(object):
|
||||||
|
self.exec_stack = True
|
||||||
|
continue
|
||||||
|
|
||||||
|
- if l.startswith("Symbol table"):
|
||||||
|
+ if line.startswith("Symbol table"):
|
||||||
|
break
|
||||||
|
|
||||||
|
- for l in lines:
|
||||||
|
- r = BinaryInfo.call_regex.search(l)
|
||||||
|
+ for line in lines:
|
||||||
|
+ r = BinaryInfo.call_regex.search(line)
|
||||||
|
if not r:
|
||||||
|
continue
|
||||||
|
- l = r.group(1)
|
||||||
|
+ line = r.group(1)
|
||||||
|
|
||||||
|
- if BinaryInfo.mktemp_call_regex.search(l):
|
||||||
|
+ if BinaryInfo.mktemp_call_regex.search(line):
|
||||||
|
self.mktemp = True
|
||||||
|
|
||||||
|
- if BinaryInfo.setgid_call_regex.search(l):
|
||||||
|
+ if BinaryInfo.setgid_call_regex.search(line):
|
||||||
|
self.setgid = True
|
||||||
|
|
||||||
|
- if BinaryInfo.setuid_call_regex.search(l):
|
||||||
|
+ if BinaryInfo.setuid_call_regex.search(line):
|
||||||
|
self.setuid = True
|
||||||
|
|
||||||
|
- if BinaryInfo.setgroups_call_regex.search(l):
|
||||||
|
+ if BinaryInfo.setgroups_call_regex.search(line):
|
||||||
|
self.setgroups = True
|
||||||
|
|
||||||
|
- if BinaryInfo.chdir_call_regex.search(l):
|
||||||
|
+ if BinaryInfo.chdir_call_regex.search(line):
|
||||||
|
self.chdir = True
|
||||||
|
|
||||||
|
- if BinaryInfo.chroot_call_regex.search(l):
|
||||||
|
+ if BinaryInfo.chroot_call_regex.search(line):
|
||||||
|
self.chroot = True
|
||||||
|
|
||||||
|
if BinaryInfo.forbidden_functions:
|
||||||
|
for r_name, func in BinaryInfo.forbidden_functions.items():
|
||||||
|
- ret = func['f_regex'].search(l)
|
||||||
|
+ ret = func['f_regex'].search(line)
|
||||||
|
if ret:
|
||||||
|
self.forbidden_calls.append(r_name)
|
||||||
|
|
||||||
|
if is_shlib:
|
||||||
|
- r = BinaryInfo.exit_call_regex.search(l)
|
||||||
|
+ r = BinaryInfo.exit_call_regex.search(line)
|
||||||
|
if r:
|
||||||
|
self.exit_calls.append(r.group(1))
|
||||||
|
continue
|
||||||
|
- r = BinaryInfo.fork_call_regex.search(l)
|
||||||
|
+ r = BinaryInfo.fork_call_regex.search(line)
|
||||||
|
if r:
|
||||||
|
fork_called = True
|
||||||
|
continue
|
||||||
|
@@ -182,14 +182,14 @@ class BinaryInfo(object):
|
||||||
|
if self.forbidden_calls:
|
||||||
|
res = Pkg.getstatusoutput(('strings', path))
|
||||||
|
if not res[0]:
|
||||||
|
- for l in res[1].splitlines():
|
||||||
|
+ for line in res[1].splitlines():
|
||||||
|
# as we need to remove elements, iterate backwards
|
||||||
|
for i in range(len(self.forbidden_calls) - 1, -1, -1):
|
||||||
|
func = self.forbidden_calls[i]
|
||||||
|
f = BinaryInfo.forbidden_functions[func]
|
||||||
|
if 'waiver_regex' not in f:
|
||||||
|
continue
|
||||||
|
- r = f['waiver_regex'].search(l)
|
||||||
|
+ r = f['waiver_regex'].search(line)
|
||||||
|
if r:
|
||||||
|
del self.forbidden_calls[i]
|
||||||
|
|
||||||
|
@@ -254,8 +254,8 @@ class BinaryInfo(object):
|
||||||
|
# We could do this with objdump, but it's _much_ simpler with ldd.
|
||||||
|
res = Pkg.getstatusoutput(('ldd', '-d', '-r', path))
|
||||||
|
if not res[0]:
|
||||||
|
- for l in res[1].splitlines():
|
||||||
|
- undef = BinaryInfo.undef_regex.search(l)
|
||||||
|
+ for line in res[1].splitlines():
|
||||||
|
+ undef = BinaryInfo.undef_regex.search(line)
|
||||||
|
if undef:
|
||||||
|
self.undef.append(undef.group(1))
|
||||||
|
if self.undef:
|
||||||
|
@@ -263,7 +263,7 @@ class BinaryInfo(object):
|
||||||
|
res = Pkg.getstatusoutput(['c++filt'] + self.undef)
|
||||||
|
if not res[0]:
|
||||||
|
self.undef = res[1].splitlines()
|
||||||
|
- except:
|
||||||
|
+ except OSError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
printWarning(pkg, 'ldd-failed', file)
|
||||||
|
@@ -272,13 +272,13 @@ class BinaryInfo(object):
|
||||||
|
# Either ldd doesn't grok -u (added in glibc 2.3.4) or we have
|
||||||
|
# unused direct dependencies
|
||||||
|
in_unused = False
|
||||||
|
- for l in res[1].splitlines():
|
||||||
|
- if not l.rstrip():
|
||||||
|
+ for line in res[1].splitlines():
|
||||||
|
+ if not line.rstrip():
|
||||||
|
pass
|
||||||
|
- elif l.startswith('Unused direct dependencies'):
|
||||||
|
+ elif line.startswith('Unused direct dependencies'):
|
||||||
|
in_unused = True
|
||||||
|
elif in_unused:
|
||||||
|
- unused = BinaryInfo.unused_regex.search(l)
|
||||||
|
+ unused = BinaryInfo.unused_regex.search(line)
|
||||||
|
if unused:
|
||||||
|
self.unused.append(unused.group(1))
|
||||||
|
else:
|
||||||
|
diff -up rpmlint-rpmlint-1.10/Config.py.flake rpmlint-rpmlint-1.10/Config.py
|
||||||
|
--- rpmlint-rpmlint-1.10/Config.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/Config.py 2018-04-17 12:22:20.684609629 -0400
|
||||||
|
@@ -42,11 +41,11 @@ USEUTF8_DEFAULT = False
|
||||||
|
try:
|
||||||
|
if locale.getpreferredencoding() == 'UTF-8':
|
||||||
|
USEUTF8_DEFAULT = True
|
||||||
|
-except:
|
||||||
|
+except UnicodeError:
|
||||||
|
try:
|
||||||
|
if re.match('utf', locale.getdefaultlocale()[1], re.I):
|
||||||
|
USEUTF8_DEFAULT = True
|
||||||
|
- except:
|
||||||
|
+ except UnicodeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
info = False
|
||||||
|
@@ -105,10 +105,7 @@ def setOption(name, value):
|
||||||
|
|
||||||
|
|
||||||
|
def getOption(name, default=""):
|
||||||
|
- try:
|
||||||
|
- return _options[name]
|
||||||
|
- except:
|
||||||
|
- return default
|
||||||
|
+ return _options.get(name, default)
|
||||||
|
|
||||||
|
|
||||||
|
# List of filters
|
||||||
|
@@ -128,7 +125,7 @@ def removeFilter(s):
|
||||||
|
|
||||||
|
try:
|
||||||
|
_filters.remove(s)
|
||||||
|
- except:
|
||||||
|
+ except ValueError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
_filters_re = None
|
||||||
|
diff -up rpmlint-rpmlint-1.10/MenuXDGCheck.py.flake rpmlint-rpmlint-1.10/MenuXDGCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/MenuXDGCheck.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/MenuXDGCheck.py 2018-04-17 12:22:20.681609697 -0400
|
||||||
|
@@ -9,7 +9,7 @@
|
||||||
|
import os
|
||||||
|
try:
|
||||||
|
from ConfigParser import RawConfigParser
|
||||||
|
-except:
|
||||||
|
+except ImportError:
|
||||||
|
from configparser import RawConfigParser
|
||||||
|
|
||||||
|
import AbstractCheck
|
||||||
|
diff -up rpmlint-rpmlint-1.10/Pkg.py.flake rpmlint-rpmlint-1.10/Pkg.py
|
||||||
|
--- rpmlint-rpmlint-1.10/Pkg.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/Pkg.py 2018-04-17 12:22:20.681609697 -0400
|
||||||
|
@@ -18,7 +18,7 @@ import sys
|
||||||
|
import tempfile
|
||||||
|
try:
|
||||||
|
from urlparse import urljoin
|
||||||
|
-except:
|
||||||
|
+except ImportError:
|
||||||
|
from urllib.parse import urljoin
|
||||||
|
|
||||||
|
try:
|
||||||
|
@@ -27,7 +27,7 @@ try:
|
||||||
|
_magic = magic.open(magic.MAGIC_NONE)
|
||||||
|
_ = _magic.descriptor # magic >= 5.05 needed
|
||||||
|
_magic.load()
|
||||||
|
-except:
|
||||||
|
+except ImportError:
|
||||||
|
_magic = None
|
||||||
|
import rpm
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ else:
|
||||||
|
|
||||||
|
try:
|
||||||
|
from shlex import quote as shquote
|
||||||
|
-except:
|
||||||
|
+except ImportError:
|
||||||
|
def shquote(s):
|
||||||
|
return '"%s"' % s
|
||||||
|
|
||||||
|
@@ -166,7 +166,7 @@ def is_utf8(fname):
|
||||||
|
def is_utf8_bytestr(s):
|
||||||
|
try:
|
||||||
|
s.decode('UTF-8')
|
||||||
|
- except:
|
||||||
|
+ except UnicodeError:
|
||||||
|
return False
|
||||||
|
return True
|
||||||
|
|
||||||
|
@@ -227,7 +227,7 @@ def get_default_valid_rpmgroups(filename
|
||||||
|
groupsfiles = [x for x in p.files() if x.endswith('/GROUPS')]
|
||||||
|
if groupsfiles:
|
||||||
|
filename = groupsfiles[0]
|
||||||
|
- except: # the rpm package might not be installed
|
||||||
|
+ except KeyError: # the rpm package might not be installed
|
||||||
|
pass
|
||||||
|
if filename and os.path.exists(filename):
|
||||||
|
with open(filename) as fobj:
|
||||||
|
@@ -532,7 +532,7 @@ class Pkg(AbstractPkg):
|
||||||
|
def __getitem__(self, key):
|
||||||
|
try:
|
||||||
|
val = self.header[key]
|
||||||
|
- except:
|
||||||
|
+ except KeyError:
|
||||||
|
val = []
|
||||||
|
if val == []:
|
||||||
|
return None
|
||||||
|
@@ -680,7 +680,7 @@ class Pkg(AbstractPkg):
|
||||||
|
magics = [b2s(x) for x in self.header[rpm.RPMTAG_FILECLASS]]
|
||||||
|
try: # rpm >= 4.7.0
|
||||||
|
filecaps = self.header[rpm.RPMTAG_FILECAPS]
|
||||||
|
- except:
|
||||||
|
+ except AttributeError:
|
||||||
|
filecaps = None
|
||||||
|
|
||||||
|
# rpm-python < 4.6 does not return a list for this (or FILEDEVICES,
|
||||||
|
@@ -915,9 +915,11 @@ class Pkg(AbstractPkg):
|
||||||
|
Depending on rpm-python version, the string may or may not include
|
||||||
|
interpreter arguments, if any.
|
||||||
|
"""
|
||||||
|
+ if which is None:
|
||||||
|
+ return ''
|
||||||
|
prog = self[which]
|
||||||
|
if prog is None:
|
||||||
|
- prog = ""
|
||||||
|
+ prog = ''
|
||||||
|
elif isinstance(prog, (list, tuple)):
|
||||||
|
# http://rpm.org/ticket/847#comment:2
|
||||||
|
prog = "".join(prog)
|
||||||
|
diff -up rpmlint-rpmlint-1.10/rpmlint.flake rpmlint-rpmlint-1.10/rpmlint
|
||||||
|
--- rpmlint-rpmlint-1.10/rpmlint.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/rpmlint 2018-04-17 12:22:20.682609674 -0400
|
||||||
|
@@ -20,7 +20,7 @@ import tempfile
|
||||||
|
|
||||||
|
try:
|
||||||
|
import importlib
|
||||||
|
-except: # Python < 2.7
|
||||||
|
+except ImportError: # Python < 2.7
|
||||||
|
importlib = None
|
||||||
|
import imp
|
||||||
|
|
||||||
|
diff -up rpmlint-rpmlint-1.10/SCLCheck.py.flake rpmlint-rpmlint-1.10/SCLCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/SCLCheck.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/SCLCheck.py 2018-04-17 12:22:20.682609674 -0400
|
||||||
|
@@ -50,7 +50,7 @@ def index_or_sub(source, word, sub=0):
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
return source.index(word)
|
||||||
|
- except:
|
||||||
|
+ except ValueError:
|
||||||
|
return sub
|
||||||
|
|
||||||
|
|
||||||
|
diff -up rpmlint-rpmlint-1.10/SpecCheck.py.flake rpmlint-rpmlint-1.10/SpecCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/SpecCheck.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/SpecCheck.py 2018-04-17 12:22:20.682609674 -0400
|
||||||
|
@@ -571,7 +571,7 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||||
|
try:
|
||||||
|
ts = rpm.TransactionSet()
|
||||||
|
spec_obj = ts.parseSpec(self._spec_file)
|
||||||
|
- except:
|
||||||
|
+ except rpm.error:
|
||||||
|
# errors logged above already
|
||||||
|
pass
|
||||||
|
if spec_obj:
|
||||||
|
diff -up rpmlint-rpmlint-1.10/ZipCheck.py.flake rpmlint-rpmlint-1.10/ZipCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/ZipCheck.py.flake 2017-09-05 02:40:05.000000000 -0400
|
||||||
|
+++ rpmlint-rpmlint-1.10/ZipCheck.py 2018-04-17 12:22:20.682609674 -0400
|
||||||
|
@@ -43,6 +43,10 @@ class ZipCheck(AbstractCheck.AbstractChe
|
||||||
|
badcrc = z.testzip()
|
||||||
|
if badcrc:
|
||||||
|
printError(pkg, 'bad-crc-in-zip', badcrc, fname)
|
||||||
|
+ except zipfile.error:
|
||||||
|
+ printWarning(pkg, 'unable-to-read-zip', '%s: %s' %
|
||||||
|
+ (fname, sys.exc_info()[1]))
|
||||||
|
+ else:
|
||||||
|
compressed = False
|
||||||
|
for zinfo in z.infolist():
|
||||||
|
if zinfo.compress_type != zipfile.ZIP_STORED:
|
||||||
|
@@ -70,9 +74,6 @@ class ZipCheck(AbstractCheck.AbstractChe
|
||||||
|
if want_indexed_jars:
|
||||||
|
printWarning(pkg, 'jar-not-indexed', fname)
|
||||||
|
pass
|
||||||
|
- except:
|
||||||
|
- printWarning(pkg, 'unable-to-read-zip', '%s: %s' %
|
||||||
|
- (fname, sys.exc_info()[1]))
|
||||||
|
|
||||||
|
z and z.close()
|
||||||
|
|
@ -0,0 +1,36 @@
|
|||||||
|
From 7f86c79068be1c83303da30f5f4f030080e6326a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Dirk Mueller <dirk@dmllr.de>
|
||||||
|
Date: Sat, 4 Nov 2017 02:24:30 +0100
|
||||||
|
Subject: [PATCH] Ignore useless-provides on debuginfo provides (#112)
|
||||||
|
|
||||||
|
Also flip to set's rather than lists as the main operation
|
||||||
|
here is lookup, so set()s should be faster.
|
||||||
|
---
|
||||||
|
TagsCheck.py | 10 ++++++----
|
||||||
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/TagsCheck.py b/TagsCheck.py
|
||||||
|
index a8d87aa..dc890b1 100644
|
||||||
|
--- a/TagsCheck.py
|
||||||
|
+++ b/TagsCheck.py
|
||||||
|
@@ -823,11 +823,13 @@ class TagsCheck(AbstractCheck.AbstractCheck):
|
||||||
|
|
||||||
|
# TODO: should take versions, <, <=, =, >=, > into account here
|
||||||
|
# https://bugzilla.redhat.com/460872
|
||||||
|
- useless_provides = []
|
||||||
|
+ useless_provides = set()
|
||||||
|
for p in prov_names:
|
||||||
|
- if prov_names.count(p) != 1 and p not in useless_provides:
|
||||||
|
- useless_provides.append(p)
|
||||||
|
- for p in useless_provides:
|
||||||
|
+ if (prov_names.count(p) != 1 and
|
||||||
|
+ not p.startswith('debuginfo(') and
|
||||||
|
+ p not in useless_provides):
|
||||||
|
+ useless_provides.add(p)
|
||||||
|
+ for p in sorted(useless_provides):
|
||||||
|
printError(pkg, 'useless-provides', p)
|
||||||
|
|
||||||
|
for p in pkg.provides():
|
||||||
|
--
|
||||||
|
2.17.0
|
||||||
|
|
@ -0,0 +1,12 @@
|
|||||||
|
diff -up rpmlint-rpmlint-1.10/TagsCheck.py.no_python2 rpmlint-rpmlint-1.10/TagsCheck.py
|
||||||
|
--- rpmlint-rpmlint-1.10/TagsCheck.py.no_python2 2019-06-13 11:13:28.506567431 +0200
|
||||||
|
+++ rpmlint-rpmlint-1.10/TagsCheck.py 2019-06-13 11:47:12.230644658 +0200
|
||||||
|
@@ -433,7 +433,7 @@ oldest_changelog_timestamp = calendar.ti
|
||||||
|
|
||||||
|
private_so_paths = set()
|
||||||
|
for path in ('%perl_archlib', '%perl_vendorarch', '%perl_sitearch',
|
||||||
|
- '%python_sitearch', '%python2_sitearch', '%python3_sitearch',
|
||||||
|
+ '%python3_sitearch',
|
||||||
|
'%ruby_sitearch', '%php_extdir'):
|
||||||
|
epath = rpm.expandMacro(path)
|
||||||
|
if epath and epath != path:
|
@ -0,0 +1,30 @@
|
|||||||
|
diff -up rpmlint-rpmlint-1.10/Pkg.py.rpm_surrogate_escaped_utf8 rpmlint-rpmlint-1.10/Pkg.py
|
||||||
|
--- rpmlint-rpmlint-1.10/Pkg.py.rpm_surrogate_escaped_utf8 2019-06-13 12:17:33.339937352 +0200
|
||||||
|
+++ rpmlint-rpmlint-1.10/Pkg.py 2019-06-13 13:37:37.076702548 +0200
|
||||||
|
@@ -164,12 +164,20 @@ def is_utf8(fname):
|
||||||
|
|
||||||
|
|
||||||
|
def is_utf8_bytestr(s):
|
||||||
|
- try:
|
||||||
|
- s.decode('UTF-8')
|
||||||
|
- except UnicodeError:
|
||||||
|
- return False
|
||||||
|
- return True
|
||||||
|
-
|
||||||
|
+ if isinstance(s, str):
|
||||||
|
+ try:
|
||||||
|
+ s.encode("utf8")
|
||||||
|
+ except UnicodeEncodeError:
|
||||||
|
+ return False
|
||||||
|
+ else:
|
||||||
|
+ return True
|
||||||
|
+ else:
|
||||||
|
+ try:
|
||||||
|
+ s.decode('UTF-8')
|
||||||
|
+ except UnicodeError:
|
||||||
|
+ return False
|
||||||
|
+ else:
|
||||||
|
+ return True
|
||||||
|
|
||||||
|
def to_unicode(string):
|
||||||
|
if string is None:
|
@ -1,38 +0,0 @@
|
|||||||
From 30290f021b58d381ce2baaa393a4902fb69e624a Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
|
||||||
Date: Sun, 10 Mar 2019 11:54:59 +0100
|
|
||||||
Subject: [PATCH] Suppress errors when setting LC_COLLATE, the problem is not
|
|
||||||
fatal
|
|
||||||
|
|
||||||
Fixes https://github.com/rpm-software-management/rpmlint/issues/198
|
|
||||||
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1668400
|
|
||||||
---
|
|
||||||
rpmlint | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/rpmlint b/rpmlint
|
|
||||||
index dd835ba..cc8f327 100755
|
|
||||||
--- a/rpmlint
|
|
||||||
+++ b/rpmlint
|
|
||||||
@@ -9,6 +9,7 @@
|
|
||||||
# the checks.
|
|
||||||
#############################################################################
|
|
||||||
|
|
||||||
+import contextlib
|
|
||||||
import getopt
|
|
||||||
import glob
|
|
||||||
import locale
|
|
||||||
@@ -89,7 +90,9 @@ def loadCheck(name):
|
|
||||||
#############################################################################
|
|
||||||
def main():
|
|
||||||
|
|
||||||
- locale.setlocale(locale.LC_COLLATE, '')
|
|
||||||
+ # we'll try to sort with locale settings, but we don't fail if not possible
|
|
||||||
+ with contextlib.suppress(locale.Error):
|
|
||||||
+ locale.setlocale(locale.LC_COLLATE, '')
|
|
||||||
|
|
||||||
# Add check dirs to the front of load path
|
|
||||||
sys.path[0:0] = Config.checkDirs()
|
|
||||||
--
|
|
||||||
2.20.1
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
diff -up rpmlint-rpmlint-1.10/config.orig rpmlint-rpmlint-1.10/config
|
||||||
|
--- rpmlint-rpmlint-1.10/config.orig 2017-09-05 08:40:05.000000000 +0200
|
||||||
|
+++ rpmlint-rpmlint-1.10/config 2020-06-04 15:43:14.135492613 +0200
|
||||||
|
@@ -230,7 +230,7 @@ from Config import *
|
||||||
|
#'''This application package calls a function to explicitly set crypto ciphers
|
||||||
|
#for SSL/TLS. That may cause the application not to use the system-wide set
|
||||||
|
#cryptographic policy and should be modified in accordance to:
|
||||||
|
-#https://fedoraproject.org/wiki/Packaging:CryptoPolicies'''
|
||||||
|
+#https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies/'''
|
||||||
|
#
|
||||||
|
#call_blacklist = {'crypto-policy-non-compliance-openssl' :
|
||||||
|
# {'f_name' : 'SSL_CTX_set_cipher_list',
|
||||||
|
@@ -242,6 +242,7 @@ from Config import *
|
||||||
|
# 'description' : bad_crypto_warning},
|
||||||
|
# 'crypto-policy-non-compliance-gnutls-2' :
|
||||||
|
# {'f_name' : 'gnutls_priority_init',
|
||||||
|
+# 'good_param' : '^@SYSTEM$',
|
||||||
|
# 'description' : bad_crypto_warning}
|
||||||
|
# }
|
||||||
|
#setOption("WarnOnFunction", call_blacklist)
|
@ -1,23 +0,0 @@
|
|||||||
diff -up rpmlint-rpmlint-1.11/test.sh.orig rpmlint-rpmlint-1.11/test.sh
|
|
||||||
--- rpmlint-rpmlint-1.11/test.sh.orig 2022-01-12 17:23:52.565790275 +0100
|
|
||||||
+++ rpmlint-rpmlint-1.11/test.sh 2022-01-12 17:24:02.043920708 +0100
|
|
||||||
@@ -2,7 +2,7 @@
|
|
||||||
|
|
||||||
export PYTHONPATH=$(pwd)/tools:$(pwd)
|
|
||||||
export TESTPATH="$(pwd)/test/"
|
|
||||||
-: ${PYTHON:=python} ${PYTEST:=py.test} ${FLAKE8:=flake8}
|
|
||||||
+: ${PYTHON:=python} ${PYTEST:=py.test}
|
|
||||||
: ${PYTHONWARNINGS:=all}
|
|
||||||
export PYTHONWARNINGS
|
|
||||||
|
|
||||||
@@ -40,10 +40,6 @@ $PYTEST -v || exit $?
|
|
||||||
|
|
||||||
unset PYTHONWARNINGS
|
|
||||||
|
|
||||||
-echo "$FLAKE8 tests"
|
|
||||||
-$FLAKE8 --version
|
|
||||||
-$FLAKE8 . ./rpmdiff ./rpmlint || exit $?
|
|
||||||
-
|
|
||||||
echo "man page tests"
|
|
||||||
if man --help 2>&1 | grep -q -- --warnings; then
|
|
||||||
tmpfile=$(mktemp) || exit 1
|
|
@ -1,16 +0,0 @@
|
|||||||
diff -up rpmlint-rpmlint-1.11/BinariesCheck.py.libcwarn rpmlint-rpmlint-1.11/BinariesCheck.py
|
|
||||||
--- rpmlint-rpmlint-1.11/BinariesCheck.py.libcwarn 2020-06-16 10:51:01.531299081 -0400
|
|
||||||
+++ rpmlint-rpmlint-1.11/BinariesCheck.py 2020-06-16 10:51:18.978910827 -0400
|
|
||||||
@@ -557,10 +557,10 @@ class BinariesCheck(AbstractCheck.Abstra
|
|
||||||
|
|
||||||
if not found_libc:
|
|
||||||
if is_shobj:
|
|
||||||
- printError(pkg, 'library-not-linked-against-libc',
|
|
||||||
+ printWarning(pkg, 'library-not-linked-against-libc',
|
|
||||||
fname)
|
|
||||||
else:
|
|
||||||
- printError(pkg, 'program-not-linked-against-libc',
|
|
||||||
+ printWarning(pkg, 'program-not-linked-against-libc',
|
|
||||||
fname)
|
|
||||||
|
|
||||||
if bin_info.stack:
|
|
@ -1,13 +0,0 @@
|
|||||||
diff --git a/TagsCheck.py b/TagsCheck.py
|
|
||||||
index 4e32520..a30b485 100644
|
|
||||||
--- a/TagsCheck.py
|
|
||||||
+++ b/TagsCheck.py
|
|
||||||
@@ -437,7 +437,7 @@ oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-
|
|
||||||
|
|
||||||
private_so_paths = set()
|
|
||||||
for path in ('%perl_archlib', '%perl_vendorarch', '%perl_sitearch',
|
|
||||||
- '%python_sitearch', '%python2_sitearch', '%python3_sitearch',
|
|
||||||
+ '%python2_sitearch', '%python3_sitearch',
|
|
||||||
'%ruby_sitearch', '%php_extdir'):
|
|
||||||
epath = rpm.expandMacro(path)
|
|
||||||
if epath and epath != path:
|
|
@ -1,34 +0,0 @@
|
|||||||
From 8fd904b53c028dded0b308ee95f1a5ff998584fd Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
|
|
||||||
Date: Thu, 4 Jul 2019 00:31:49 +0200
|
|
||||||
Subject: [PATCH] Ugly workaround for RPM 4.14 vs 4.15 python3 bindings
|
|
||||||
incompatibility
|
|
||||||
|
|
||||||
Fixes https://github.com/rpm-software-management/rpmlint/issues/202
|
|
||||||
---
|
|
||||||
Pkg.py | 11 ++++++++++-
|
|
||||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/Pkg.py b/Pkg.py
|
|
||||||
index 8d01f301..1b257716 100644
|
|
||||||
--- a/Pkg.py
|
|
||||||
+++ b/Pkg.py
|
|
||||||
@@ -143,8 +143,17 @@ def is_utf8(fname):
|
|
||||||
|
|
||||||
|
|
||||||
def is_utf8_bytestr(s):
|
|
||||||
+ """Returns True whether the given text is UTF-8.
|
|
||||||
+ Due to changes in rpm, needs to handle both bytes and unicode."""
|
|
||||||
try:
|
|
||||||
- s.decode('UTF-8')
|
|
||||||
+ if hasattr(s, 'decode'):
|
|
||||||
+ s.decode('utf-8')
|
|
||||||
+ elif hasattr(s, 'encode'):
|
|
||||||
+ s.encode('utf-8')
|
|
||||||
+ else:
|
|
||||||
+ unexpected = type(s).__name__
|
|
||||||
+ raise TypeError(
|
|
||||||
+ 'Expected str/unicode/bytes, not {}'.format(unexpected))
|
|
||||||
except UnicodeError:
|
|
||||||
return False
|
|
||||||
return True
|
|
@ -1,13 +0,0 @@
|
|||||||
diff -up rpmlint-rpmlint-1.11/TagsCheck.py.orig rpmlint-rpmlint-1.11/TagsCheck.py
|
|
||||||
--- rpmlint-rpmlint-1.11/TagsCheck.py.orig 2022-01-11 16:49:18.424026182 +0100
|
|
||||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py 2022-01-11 16:50:05.774665734 +0100
|
|
||||||
@@ -463,7 +463,8 @@ def spell_check(pkg, str, fmt, lang, ign
|
|
||||||
lang, filters=[enchant.tokenize.EmailFilter,
|
|
||||||
enchant.tokenize.URLFilter,
|
|
||||||
enchant.tokenize.WikiWordFilter])
|
|
||||||
- except enchant.DictNotFoundError:
|
|
||||||
+ except (enchant.errors.DefaultLanguageNotFoundError,
|
|
||||||
+ enchant.DictNotFoundError):
|
|
||||||
printInfo(pkg, 'enchant-dictionary-not-found', lang)
|
|
||||||
pass
|
|
||||||
_enchant_checkers[lang] = checker
|
|
@ -0,0 +1,28 @@
|
|||||||
|
# -*- python -*-
|
||||||
|
|
||||||
|
# System wide rpmlint default configuration. Do not modify, override/add
|
||||||
|
# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed.
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from Config import *
|
||||||
|
import Pkg
|
||||||
|
|
||||||
|
# Inherit the base config and build from there.
|
||||||
|
exec(open("/usr/share/rpmlint/config","rb").read())
|
||||||
|
|
||||||
|
# Fedora 12 and newer no longer need a buildroot defined, to have the buildroot cleaned at the beginning
|
||||||
|
# of %install, and do not need to define a %clean section unless the default is invalid.
|
||||||
|
# However, EL-4 and EL-5 still need these checks.
|
||||||
|
removeFilter("no-cleaning-of-buildroot")
|
||||||
|
removeFilter("no-buildroot-tag")
|
||||||
|
removeFilter("no-%clean-section")
|
||||||
|
|
||||||
|
# Only EL4 needs the files-attr-not-set check, because rpm 4.4 and newer no longer need a %defattr line
|
||||||
|
# (it automatically provides one).
|
||||||
|
removeFilter("files-attr-not-set")
|
||||||
|
|
||||||
|
# Fixed in rpm >= 4.7.1
|
||||||
|
removeFilter("broken-syntax-in-scriptlet-requires")
|
@ -0,0 +1,24 @@
|
|||||||
|
# -*- python -*-
|
||||||
|
|
||||||
|
# System wide rpmlint default configuration. Do not modify, override/add
|
||||||
|
# options in /etc/rpmlint/config and/or ~/.rpmlintrc as needed.
|
||||||
|
|
||||||
|
import os.path
|
||||||
|
import re
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from Config import *
|
||||||
|
import Pkg
|
||||||
|
|
||||||
|
# Inherit the base config and build from there.
|
||||||
|
exec(open("/usr/share/rpmlint/config","rb").read())
|
||||||
|
|
||||||
|
# Fedora 12 and newer no longer need a buildroot defined, to have the buildroot cleaned at the beginning
|
||||||
|
# of %install, and do not need to define a %clean section unless the default is invalid.
|
||||||
|
# However, EL-4 and EL-5 still need these checks.
|
||||||
|
removeFilter("no-cleaning-of-buildroot")
|
||||||
|
removeFilter("no-buildroot-tag")
|
||||||
|
removeFilter("no-%clean-section")
|
||||||
|
|
||||||
|
# Fixed in rpm >= 4.7.1
|
||||||
|
removeFilter("broken-syntax-in-scriptlet-requires")
|
Loading…
Reference in new issue