Compare commits

...

No commits in common. "c8" and "c9" have entirely different histories.
c8 ... c9

18 changed files with 361 additions and 644 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/rpmlint-1.10.tar.gz SOURCES/rpmlint-1.11.tar.gz

View File

@ -1 +1 @@
d77b498d42d6d7ef044df14a0f37cf88e520cebd SOURCES/rpmlint-1.10.tar.gz 473ddaabbe28a2f5836116d4b19e4a9b641fd038 SOURCES/rpmlint-1.11.tar.gz

View File

@ -1,25 +0,0 @@
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

View File

@ -1,358 +0,0 @@
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()

View File

@ -1,36 +0,0 @@
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

View File

@ -1,12 +0,0 @@
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:

View File

@ -1,30 +0,0 @@
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:

View File

@ -0,0 +1,38 @@
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

View File

@ -1,20 +0,0 @@
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)

View File

@ -0,0 +1,23 @@
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

View File

@ -0,0 +1,16 @@
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:

View File

@ -0,0 +1,13 @@
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:

View File

@ -0,0 +1,34 @@
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

View File

@ -0,0 +1,13 @@
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

View File

@ -23,6 +23,7 @@ setOption("UseEpoch", False)
setOption("UseUTF8", True) setOption("UseUTF8", True)
setOption("UseVersionInChangeLog", True) setOption("UseVersionInChangeLog", True)
setOption("ValidSrcPerms", (int("664",8), int("644",8), )) setOption("ValidSrcPerms", (int("664",8), int("644",8), ))
setOption("ValidGroups", [])
setOption("ValidShells", ( setOption("ValidShells", (
"<lua>", "<lua>",
@ -30,8 +31,9 @@ setOption("ValidShells", (
"/bin/bash", "/bin/bash",
"/sbin/ldconfig", "/sbin/ldconfig",
"/usr/bin/perl", "/usr/bin/perl",
"/usr/bin/python",
"/usr/bin/python2",
"/usr/bin/python3", "/usr/bin/python3",
"/usr/libexec/platform-python",
)) ))
setOption("DanglingSymlinkExceptions", ( setOption("DanglingSymlinkExceptions", (
@ -42,7 +44,7 @@ setOption("DanglingSymlinkExceptions", (
setOption("ValidLicenses", ( setOption("ValidLicenses", (
# These are the short names for all of the Fedora approved licenses. # These are the short names for all of the Fedora approved licenses.
# The master list is kept here: http://fedoraproject.org/wiki/Licensing # The master list is kept here: http://fedoraproject.org/wiki/Licensing
# Last synced with revision "2.36, 18 April 2017" of that page. # Last synced with revision "2.47, July 3, 2018" of that page.
'AAL', 'AAL',
'Abstyles', 'Abstyles',
'Adobe', 'Adobe',
@ -56,19 +58,17 @@ setOption("ValidLicenses", (
'AMDPLPA', 'AMDPLPA',
'AML', 'AML',
'AMPAS BSD', 'AMPAS BSD',
'ANTLR-PD',
'APAFML', 'APAFML',
'App-s2p', 'App-s2p',
'APSL 2.0', 'APSL 2.0',
'APSL 2.0+',
'ARL', 'ARL',
'Array',
'Artistic 2.0', 'Artistic 2.0',
'Artistic clarified', 'Artistic clarified',
'ASL 1.0', 'ASL 1.0',
'ASL 1.0+',
'ASL 1.1', 'ASL 1.1',
'ASL 1.1+',
'ASL 2.0', 'ASL 2.0',
'ASL 2.0+',
'Bahyph', 'Bahyph',
'Barr', 'Barr',
'Beerware', 'Beerware',
@ -86,12 +86,14 @@ setOption("ValidLicenses", (
'CeCILL', 'CeCILL',
'CeCILL-B', 'CeCILL-B',
'CeCILL-C', 'CeCILL-C',
'CDDL', 'CDDL-1.0',
'CDDL-1.1',
'CNRI', 'CNRI',
'Condor', 'Condor',
'Copyright only', 'Copyright only',
'CPAL', 'CPAL',
'CPL', 'CPL',
'CPM',
'CRC32', 'CRC32',
'Crossword', 'Crossword',
'Crystal Stacker', 'Crystal Stacker',
@ -107,16 +109,18 @@ setOption("ValidLicenses", (
'ECL 2.0', 'ECL 2.0',
'eCos', 'eCos',
'EFL 2.0', 'EFL 2.0',
'EFL 2.0+',
'eGenix', 'eGenix',
'Entessa', 'Entessa',
'EPICS', 'EPICS',
'EPL', 'EPL-1.0',
'EPL-2.0',
'ERPL', 'ERPL',
'EU Datagrid', 'EU Datagrid',
'EUPL 1.1', 'EUPL 1.1',
'Eurosym', 'Eurosym',
'Fair', 'Fair',
'FDK-AAC',
'FSFAP',
'FSFUL', 'FSFUL',
'FSFULLR', 'FSFULLR',
'FTL', 'FTL',
@ -146,6 +150,7 @@ setOption("ValidLicenses", (
'ImageMagick', 'ImageMagick',
'iMatix', 'iMatix',
'Imlib2', 'Imlib2',
'Inner-Net',
'Intel ACPI', 'Intel ACPI',
'Interbase', 'Interbase',
'ISC', 'ISC',
@ -183,9 +188,7 @@ setOption("ValidLicenses", (
'mod_macro', 'mod_macro',
'Motosoto', 'Motosoto',
'MPLv1.0', 'MPLv1.0',
'MPLv1.0+',
'MPLv1.1', 'MPLv1.1',
'MPLv1.1+',
'MPLv2.0', 'MPLv2.0',
'MS-PL', 'MS-PL',
'MS-RL', 'MS-RL',
@ -198,6 +201,7 @@ setOption("ValidLicenses", (
'Newmat', 'Newmat',
'Newsletr', 'Newsletr',
'NGPL', 'NGPL',
'NISTSL',
'NLPL', 'NLPL',
'Nmap', 'Nmap',
'Nokia', 'Nokia',
@ -210,15 +214,10 @@ setOption("ValidLicenses", (
'OpenSSL', 'OpenSSL',
'OReilly', 'OReilly',
'OSL 1.0', 'OSL 1.0',
'OSL 1.0+',
'OSL 1.1', 'OSL 1.1',
'OSL 1.1+',
'OSL 2.0', 'OSL 2.0',
'OSL 2.0+',
'OSL 2.1', 'OSL 2.1',
'OSL 2.1+',
'OSL 3.0', 'OSL 3.0',
'OSL 3.0+',
'Par', 'Par',
'Phorum', 'Phorum',
'PHP', 'PHP',
@ -231,14 +230,17 @@ setOption("ValidLicenses", (
'Python', 'Python',
'Qhull', 'Qhull',
'QPL', 'QPL',
'radvd',
'Rdisc', 'Rdisc',
'REX', 'REX',
'RiceBSD', 'RiceBSD',
'Romio', 'Romio',
'RPSL', 'RPSL',
'RSA',
'Rsfs', 'Rsfs',
'Ruby', 'Ruby',
'Saxpath', 'Saxpath',
'Sequence',
'SCEA', 'SCEA',
'SCRIP', 'SCRIP',
'Sendmail', 'Sendmail',
@ -263,6 +265,7 @@ setOption("ValidLicenses", (
'TPDL', 'TPDL',
'TPL', 'TPL',
'TTWL', 'TTWL',
'Tumbolia',
'UCAR', 'UCAR',
'UCD', 'UCD',
'Unicode', 'Unicode',
@ -276,6 +279,7 @@ setOption("ValidLicenses", (
'Wsuipa', 'Wsuipa',
'WTFPL', 'WTFPL',
'wxWidgets', 'wxWidgets',
'wxWindows',
'Xerox', 'Xerox',
'xinetd', 'xinetd',
'xpp', 'xpp',
@ -286,11 +290,8 @@ setOption("ValidLicenses", (
'zlib', 'zlib',
'zlib with acknowledgement', 'zlib with acknowledgement',
'ZPLv1.0', 'ZPLv1.0',
'ZPLv1.0+',
'ZPLv2.0', 'ZPLv2.0',
'ZPLv2.0+',
'ZPLv2.1', 'ZPLv2.1',
'ZPLv2.1+',
# Documentation licenses # Documentation licenses
'CDL', 'CDL',
'FBSDDL', 'FBSDDL',
@ -312,13 +313,18 @@ setOption("ValidLicenses", (
'GeoGratis', 'GeoGratis',
'Green OpenMusic', 'Green OpenMusic',
'OAL', 'OAL',
'PDDL-1.0',
# Font licenses # Font licenses
'AMS', 'AMS',
'Arphic', 'Arphic',
'Baekmuk', 'Baekmuk',
'Bitstream Vera', 'Bitstream Vera',
'Charter',
'DoubleStroke', 'DoubleStroke',
'ec',
'Elvish',
'Hershey', 'Hershey',
'HOFL',
'IPA', 'IPA',
'Liberation', 'Liberation',
'Lucida', 'Lucida',
@ -326,6 +332,7 @@ setOption("ValidLicenses", (
'mplus', 'mplus',
'OFL', 'OFL',
'PTFL', 'PTFL',
'Punknova',
'STIX', 'STIX',
'Utopia', 'Utopia',
'Wadalab', 'Wadalab',
@ -392,15 +399,17 @@ addFilter("non-versioned-file-in-library-package")
addFilter("requires-on-release") addFilter("requires-on-release")
addFilter("jar-not-indexed") addFilter("jar-not-indexed")
addFilter("outside-libdir-files") addFilter("outside-libdir-files")
addFilter("-debuginfo.* no-documentation") addFilter("-debug(info|source).* no-documentation")
addFilter("-debuginfo.* /usr/lib/debug/") addFilter("-debuginfo.* /usr/lib/debug/")
addFilter("-debugsource.* /usr/src/debug/")
addFilter("non-standard-dir-in-usr libexec") addFilter("non-standard-dir-in-usr libexec")
addFilter("^gpg-pubkey:") addFilter("^gpg-pubkey:")
addFilter(" doc-file-dependency .* /bin/sh$") addFilter(" doc-file-dependency .* /bin/sh$")
addFilter("hardcoded-library-path .*/lib/udev(/|$)") addFilter("hardcoded-library-path .*/lib/udev(/|$)")
addFilter("not-standard-release-extension") addFilter("not-standard-release-extension")
addFilter("explicit-lib-dependency (liberation-fonts|libertas-.*-firmware|libvirt$|.*-(java|python)$)") addFilter("explicit-lib-dependency (liberation-fonts|libertas-.*-firmware|libvirt$|.*-(java|python|utils)$)")
addFilter("explicit-lib-dependency (python-.*lib.*|python2-.*lib.*|python3-.*lib.*)$") addFilter("explicit-lib-dependency (python-.*lib.*|python2-.*lib.*|python3-.*lib.*)$")
addFilter("explicit-lib-dependency libreoffice.*$")
addFilter("filename-too-long-for-joliet") addFilter("filename-too-long-for-joliet")
addFilter("symlink-should-be-") addFilter("symlink-should-be-")
addFilter(r"dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$") addFilter(r"dangling-\S*symlink /usr/share/doc/HTML/\S+/common .+/common$")
@ -414,10 +423,9 @@ addFilter("no-%clean-section")
# Only EL4 needs the files-attr-not-set check, because rpm 4.4 and newer no longer need a %defattr line # 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). # (it automatically provides one).
addFilter("files-attr-not-set") addFilter("files-attr-not-set")
# Don't bother with the non-ghost-in-var-(lock|run) checks on Fedora 15 or newer # Don't bother with the non-ghost-in-run checks, /var/lock and /var/run are
# since they have tmpfs /var/lock and /var/run. # symlinks to /run/lock and /run respectively, and /run is a tmpfs
addFilter("non-ghost-in-var-lock") addFilter("non-ghost-in-run")
addFilter("non-ghost-in-var-run")
# Someone thought it was a good idea to make .desktop files executable. They were wrong. # Someone thought it was a good idea to make .desktop files executable. They were wrong.
# Nevertheless, I do not yet control the universe, so we squelch the error here. # Nevertheless, I do not yet control the universe, so we squelch the error here.
addFilter(r"script-without-shebang .*\.desktop$") addFilter(r"script-without-shebang .*\.desktop$")
@ -440,29 +448,38 @@ addFilter(r"invalid-url .*github\.com/.*HTTP Error 403")
addFilter("-debuginfo.* description-line-too-long") addFilter("-debuginfo.* description-line-too-long")
# ignore "common" jargon words # ignore "common" jargon words
# https://bugzilla.redhat.com/show_bug.cgi?id=1424684#c9 # https://bugzilla.redhat.com/show_bug.cgi?id=1424684#c9
addFilter(r"spelling-error.* \b(runtime|Runtime|metadata|cryptographic|multi|linux|filesystem|filesystems|backend|backends|userspace|addon|wayland|Wayland|util|utils|lossless|virtualization|toolkits|libvirtd|crypto|glyphs|GStreamer|http|extensibility|codec|codecs|truetype|scalable|pluggable|pixbuf|Kerberos|customizable|bitstream|tcp|libXss|libs|libc|encodings|GLib|udev|posix|libpng|glapi|gbm|freedesktop|spi|realtime|preprocessor|libaudit|hypervisor|embeddable|distributable|devel|config|cairo|bootloader|adaptors|pragma|passphrase|malloc|libvirt|libmagic|io|datetime|boolean|argparse|py|pinentry|namespace|middleware|lowlevel|libxcb|libudev|libsoup|libgcrypt|libcom|iSCSI|initramfs|GObject|executables|dialogs|checkpolicy|bitmapped|assistive)\b") addFilter(r"spelling-error.* \b(runtime|Runtime|metadata|cryptographic|multi|linux|filesystem|filesystems|backend|backends|userspace|addon|wayland|Wayland|util|utils|lossless|virtualization|toolkits|libvirtd|crypto|glyphs|GStreamer|http|extensibility|codec|codecs|truetype|scalable|pluggable|pixbuf|Kerberos|customizable|bitstream|tcp|libXss|libs|libc|encodings|GLib|udev|posix|libpng|glapi|gbm|freedesktop|spi|realtime|preprocessor|libaudit|hypervisor|embeddable|distributable|devel|config|cairo|bootloader|adaptors|pragma|passphrase|malloc|libvirt|libmagic|io|datetime|boolean|argparse|py|pinentry|namespace|middleware|lowlevel|libxcb|libudev|libsoup|libgcrypt|libcom|iSCSI|initramfs|GObject|executables|dialogs|checkpolicy|bitmapped|assistive|btrfs|crypttab|defrag|dracut|hostname|luks|mountpoints|netdev|rpmnew|rpmsave|storaged|tss|unlocker)\b")
# Fedora no longer uses explicit ldconfig %post/%postun as of Fedora 28 # Fedora no longer uses explicit ldconfig %post/%postun as of Fedora 28
addFilter("library-without-ldconfig-postin") addFilter("library-without-ldconfig-postin")
addFilter("library-without-ldconfig-postun") addFilter("library-without-ldconfig-postun")
# Ignore 700 dir perms here
addFilter("non-standard-dir-perm /etc/.* 700")
addFilter("non-standard-dir-perm /var/lib/.* 700")
# Fedora no longer requires install-info scriptlets
addFilter("info-files-without-install-info-postin")
addFilter("info-files-without-install-info-postun")
addFilter("postin-without-install-info")
# pip 20.2 generates PEP 376 "REQUESTED" marker (empty)
addFilter(r"zero-length .+/site-packages/.+\.dist-info/REQUESTED\b")
# py.typed files are empty
addFilter(r"zero-length .+/site-packages/.+/py\.typed\b")
bad_crypto_warning = \ bad_crypto_warning = \
'''This application package calls a function to explicitly set crypto ciphers '''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 for SSL/TLS. That may cause the application not to use the system-wide set
cryptographic policy and should be modified in accordance to: cryptographic policy and should be modified in accordance to:
https://docs.fedoraproject.org/en-US/packaging-guidelines/CryptoPolicies/''' https://fedoraproject.org/wiki/Packaging:CryptoPolicies'''
call_blacklist = {'crypto-policy-non-compliance-openssl' : call_blacklist = {'crypto-policy-non-compliance-openssl' :
{'f_name' : 'SSL_CTX_set_cipher_list', {'f_name' : 'SSL_CTX_set_cipher_list',
'good_param' : '^PROFILE=SYSTEM$', 'good_param' : 'PROFILE=SYSTEM',
'description' : bad_crypto_warning}, 'description' : bad_crypto_warning},
'crypto-policy-non-compliance-gnutls-1' : 'crypto-policy-non-compliance-gnutls-1' :
{'f_name' : 'gnutls_priority_set_direct', {'f_name' : 'gnutls_priority_set_direct',
'good_param' : '^@SYSTEM$',
'description' : bad_crypto_warning}, 'description' : bad_crypto_warning},
'crypto-policy-non-compliance-gnutls-2' : 'crypto-policy-non-compliance-gnutls-2' :
{'f_name' : 'gnutls_priority_init', {'f_name' : 'gnutls_priority_init',
'good_param' : '^@SYSTEM$', 'good_param' : 'SYSTEM',
'description' : bad_crypto_warning} 'description' : bad_crypto_warning}
} }
setOption("WarnOnFunction", call_blacklist) setOption("WarnOnFunction", call_blacklist)

View File

@ -1,28 +0,0 @@
# -*- 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")

View File

@ -1,24 +0,0 @@
# -*- 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")

View File

@ -4,100 +4,115 @@
%bcond_with python3 %bcond_with python3
%endif %endif
# Disable automatic compilation of Python files in /usr/share/rpmlint
%global _python_bytecompile_extra 0
%if %{with python3} %if %{with python3}
%global python %{__python3} %global python %{__python3}
%global pytest %(ls -1 %{_bindir}/py.test-3* | tail -n 1) %global pytest pytest-3
# The flake8 packages will be removed from non-modular RHEL
#global flake8 python3-flake8
%global flake8 true
%else %else
%global python %{__python} %global python %{__python2}
%global pytest py.test %global pytest py.test
%global flake8 flake8
%endif %endif
Name: rpmlint Name: rpmlint
Version: 1.10 Version: 1.11
Release: 14%{?dist} Release: 19%{?dist}
Summary: Tool for checking common errors in RPM packages Summary: Tool for checking common errors in RPM packages
Group: Development/Tools
License: GPLv2 License: GPLv2
URL: https://github.com/rpm-software-management/rpmlint URL: https://github.com/rpm-software-management/rpmlint
Source0: https://github.com/rpm-software-management/rpmlint/archive/rpmlint-%{version}.tar.gz Source0: %{url}/archive/rpmlint-%{version}.tar.gz
Source1: %{name}.config Source1: %{name}.config
Source3: %{name}-etc.config Source3: %{name}-etc.config
# EL-4 specific config
Source4: %{name}.config.el4 # https://github.com/rpm-software-management/rpmlint/pull/199
# EL-5 specific config Patch199: rpmlint-1.10-suppress-locale-error.patch
Source5: %{name}.config.el5 # https://github.com/rpm-software-management/rpmlint/pull/212
# https://github.com/rpm-software-management/rpmlint/commit/e739876 Patch212: rpmlint-1.11-rpm4.15.patch
Patch0: rpmlint-1.10-ignore-debuginfo-useless-provides.patch # Upstream changed to a warning here
# https://github.com/rpm-software-management/rpmlint/commit/b748e6fadb8e68df2aa679ccf62822ad56577b80 # https://github.com/rpm-software-management/rpmlint/pull/363
# https://github.com/rpm-software-management/rpmlint/commit/c1945e37e2989364c5caedc05aa429a5c2d39f4d # This patch does the same on the 1.11 code
# https://github.com/rpm-software-management/rpmlint/commit/f267bf1c60d067436b360c68d8e956876758b268 Patch213: rpmlint-1.11-libc-warnings.patch
Patch1: rpmlint-1.10-flake-cleanups.patch # Don't use the %%python_sitelib macro, because it errors
Patch2: rpmlint-1.10-no_python2.patch # See https://fedoraproject.org/wiki/Changes/PythonMacroError
Patch3: rpmlint-1.10-fix_test.patch Patch214: rpmlint-1.11-no-python-macro.patch
Patch4: rpmlint-1.10-rpm_surrogate_escaped_utf8.patch
Patch5: rpmlint-1.10-update-crypto-example.patch # Downstream-only patches
Patch215: rpmlint-1.11-spellcheck-handle-missing-language-error.patch
Patch216: rpmlint-1.11-disable-flake8-self-test.patch
BuildArch: noarch BuildArch: noarch
BuildRequires: make
%if %{with python3} %if %{with python3}
%if 0%{?rhel} > 7
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: rpm-python3 >= 4.4.2.2 BuildRequires: python3-rpm >= 4.4.2.2
%else
BuildRequires: python3-devel
BuildRequires: rpm-python3 >= 4.4.2.2
%endif
BuildRequires: python3-pytest BuildRequires: python3-pytest
#BuildRequires: python3-flake8-import-order Requires: python3
%{?__python3:Requires: %{__python3}} Requires: python3-rpm >= 4.4.2.2
Requires: rpm-python3 >= 4.4.2.2
%else %else
BuildRequires: python >= 2.6 BuildRequires: python >= 2.6
BuildRequires: rpm-python >= 4.4.2.2 BuildRequires: rpm-python >= 4.4.2.2
BuildRequires: pytest BuildRequires: pytest
#BuildRequires: python2-flake8-import-order
Requires: python >= 2.6 Requires: python >= 2.6
Requires: rpm-python >= 4.4.2.2 Requires: rpm-python >= 4.4.2.2
%endif %endif
BuildRequires: sed >= 3.95 BuildRequires: sed >= 3.95
BuildRequires: bash-completion BuildRequires: bash-completion
Requires: perl-interpreter
%if ! 0%{?rhel}
# python-magic and python-enchant are actually optional dependencies, but # python-magic and python-enchant are actually optional dependencies, but
# they bring quite desirable features. They're not available in RHEL/EPEL 5 # they bring quite desirable features.
# as of 2010-06-23 though.
%if %{with python3} %if %{with python3}
%if 0%{?fedora} >= 33 || 0%{?rhel} >= 9
Requires: python3-file-magic
BuildRequires: python3-file-magic
%else
Requires: python3-magic Requires: python3-magic
BuildRequires: python3-magic
%endif
Requires: python3-enchant Requires: python3-enchant
%else %else
Requires: python-magic %if 0%{?rhel} == 7
# RHEL 6 has 5.04
Requires: python-magic > 5.05
BuildRequires: python-magic > 5.05
Requires: python-enchant Requires: python-enchant
%endif %endif
%endif %endif
Requires: cpio Requires: /usr/bin/appstream-util
Requires: binutils Requires: /usr/bin/cpio
Requires: desktop-file-utils Requires: /usr/bin/bzip2
Requires: gzip Requires: /usr/bin/desktop-file-validate
Requires: bzip2 BuildRequires: /usr/bin/desktop-file-validate
Requires: xz Requires: /usr/bin/groff
# Needed for man page check in FilesCheck.py Requires: /usr/bin/gtbl
Requires: %{_bindir}/groff Requires: /usr/bin/man
Requires: /usr/bin/perl
BuildRequires: /usr/bin/perl
Requires: /usr/bin/readelf
Requires: /usr/bin/xz
%description %description
rpmlint is a tool for checking common errors in RPM packages. Binary rpmlint is a tool for checking common errors in RPM packages. Binary
and source packages as well as spec files can be checked. and source packages as well as spec files can be checked.
%prep %prep
%setup -q -n %{name}-%{name}-%{version} %setup -q -n %{name}-%{name}-%{version}
%patch0 -p1 -b .debuginfo-useless-provides %if %{with python3}
%patch1 -p1 -b .flake %patch199 -p1
%patch2 -p1 -b .no_python2 %patch212 -p1
%patch3 -p1 -b .fix_test %patch213 -p1
%patch4 -p1 -b .rpm_surrogate_escaped_utf8 %patch214 -p1
%patch5 -p1 -b .update_crypto_example %patch215 -p1
%patch216 -p1
sed -i 's|1.10|%{version}|g' Makefile
%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9
# TODO, take upstream (RPM 4.15 related)
sed -i "s/'wb'/'w'/" PostCheck.py
%endif
%endif
sed -i -e /MenuCheck/d Config.py sed -i -e /MenuCheck/d Config.py
cp -p config config.example cp -p config config.example
install -pm 644 %{SOURCE3} config install -pm 644 %{SOURCE3} config
@ -113,17 +128,19 @@ make install DESTDIR=$RPM_BUILD_ROOT ETCDIR=%{_sysconfdir} MANDIR=%{_mandir} \
LIBDIR=%{_datadir}/rpmlint BINDIR=%{_bindir} PYTHON=%{python} LIBDIR=%{_datadir}/rpmlint BINDIR=%{_bindir} PYTHON=%{python}
install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config install -pm 644 %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config
install -pm 644 %{SOURCE4} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config.el4
install -pm 644 %{SOURCE5} $RPM_BUILD_ROOT%{_datadir}/rpmlint/config.el5
pushd $RPM_BUILD_ROOT%{_bindir}
ln -s rpmlint el4-rpmlint
ln -s rpmlint el5-rpmlint
popd
rm -rf %{buildroot}%{_sysconfdir}/bash_completion.d/ rm -rf %{buildroot}%{_sysconfdir}/bash_completion.d/
%check %check
make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8} %if 0%{?rhel} == 6
# EPEL6 pytest doesn't support -k, so we sed the test names to skip them
# TestPythonBytecodeMtime.test_pyc_mtime/magic_from_chunk has 2.6 incompatible code
sed -i 's/test_pyc_m/xxx_pyc_m/' test/test_files.py
# TestSourceCheck.test_inconsistent_file_extension only works with magic >= 5.05
sed -i 's/test_inconsistent_file_extension/xxx_inconsistent_file_extension/' test/test_sources.py
%endif
make check PYTHON=%{python} PYTEST=%{pytest}
%files %files
@ -132,33 +149,112 @@ make check PYTHON=%{python} PYTEST=%{pytest} FLAKE8=%{flake8}
%config(noreplace) %{_sysconfdir}/rpmlint/ %config(noreplace) %{_sysconfdir}/rpmlint/
%{_datadir}/bash-completion/completions/ %{_datadir}/bash-completion/completions/
%{_bindir}/rpmdiff %{_bindir}/rpmdiff
%{_bindir}/el*-rpmlint
%{_bindir}/rpmlint %{_bindir}/rpmlint
%{_datadir}/rpmlint/ %{_datadir}/rpmlint/
%{_mandir}/man1/rpmdiff.1* %{_mandir}/man1/rpmdiff.1*
%{_mandir}/man1/rpmlint.1* %{_mandir}/man1/rpmlint.1*
%changelog %changelog
* Thu Jun 04 2020 Michal Domonkos <mdomonko@redhat.com> - 1.10-14 * Wed Jan 12 2022 Michal Domonkos <mdomonko@redhat.com> - 1.11-19
- Update crypto warnings in config file to reflect current Fedora policy - Disable flake8 self-test (#1929210)
(RHBZ#1797545)
* Fri Jun 14 2019 Thomas Woerner <twoerner@redhat.com> - 1.10.13.2 * Mon Jan 10 2022 Michal Domonkos <mdomonko@redhat.com> - 1.11-18
- Handle rpm change to return surrogate-escaped utf-8 python strings - Enable bash-completion (#1999654)
(RHBZ#1693712) - Handle missing language error during spellcheck (#1929210)
* Thu Jun 13 2019 Thomas Woerner <twoerner@redhat.com> - 1.10.13.1 * Tue Aug 10 2021 Mohan Boddu <mboddu@redhat.com> - 1.11-17
- Fix unit test: use platform-python, py.test-3, no flake8 (RHBZ#1576803) - Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
- Update of ValidShells (RHBZ#1633698) Related: rhbz#1991688
- Remove Python2 paths from TagsCheck.py (RHBZ#1633698)
- Enable bash-competion scripts (RHBZ#1577890)
* Thu Sep 20 2018 Tomas Orsava <torsava@redhat.com> - 1.10-13 * Fri Apr 16 2021 Mohan Boddu <mboddu@redhat.com> - 1.11-16
- Require the Python interpreter directly instead of using the package name - Rebuilt for RHEL 9 BETA on Apr 15th 2021. Related: rhbz#1947937
- Related: rhbz#1619153
* Mon Jun 25 2018 Petr Viktorin <pviktori@redhat.com> - 1.10-12 * Fri Feb 5 2021 Tom Callaway <spot@fedoraproject.org> - 1.11-15
- Remove the flake8 build dependency - correct hard-coded version in Makefile
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Mon Jan 25 2021 Miro Hrončok <mhroncok@redhat.com> - 1.11-13
- Filter out empty py.typed files in Python site-packages
* Fri Aug 21 2020 Miro Hrončok <mhroncok@redhat.com> - 1.11-12
- Filter out empty REQUESTED files in pip installed Python metadata dist-info dirs
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-11
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Thu Jul 16 2020 Miro Hrončok <mhroncok@redhat.com> - 1.11-10
- Don't use the %%python_sitelib macro, because it errors
- See https://fedoraproject.org/wiki/Changes/PythonMacroError
* Tue Jun 23 2020 Tom Callaway <spot@fedoraproject.org> - 1.11-9
- use python3-file-magic on f33+
* Tue Jun 16 2020 Tom Callaway <spot@fedoraproject.org> - 1.11-8
- turn *-not-linked-against-libc from errors to warnings (bz1749738)
* Wed Jun 10 2020 Tom Callaway <spot@fedoraproject.org> - 1.11-7
- add /usr/bin/python[23] as valid shells
* Sun May 24 2020 Miro Hrončok <mhroncok@redhat.com> - 1.11-6
- Rebuilt for Python 3.9
* Thu Jan 30 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
* Sat Aug 17 2019 Miro Hrončok <mhroncok@redhat.com> - 1.11-4
- Rebuilt for Python 3.8
* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.11-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
* Thu Jul 11 2019 Tom Callaway <spot@fedoraproject.org> - 1.11-2
- merge conflig file cleanups from PR
* Fri Jun 21 2019 Tom Callaway <spot@fedoraproject.org> - 1.11-1
- update to 1.11
* Sun Mar 10 2019 Miro Hrončok <mhroncok@redhat.com> - 1.10-22
- Suppress locale error in order to work in default mock (#1668400)
* Sat Feb 02 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Wed Jan 16 2019 Tom Callaway <spot@fedoraproject.org> - 1.10-20
- ignore info-files-without-install-info-postin/postun checks
* Fri Dec 7 2018 Tom Callaway <spot@fedoraproject.org> - 1.10-19
- ignore non-standard-dir-perm error for 700 dirs in /etc and /var/lib
* Fri Oct 5 2018 Tom Callaway <spot@fedoraproject.org> - 1.10-18
- force python3 as exec binary
* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 1.10-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
* Mon Jun 18 2018 Miro Hrončok <mhroncok@redhat.com> - 1.10-16
- Rebuilt for Python 3.7
* Sun Jun 17 2018 Todd Zullinger <tmz@pobox.com> - 1.10-15
- Fix mixed-use-of-spaces-and-tabs warning (in this spec file)
- Remove el4/el5 configs and /usr/bin symlinks
- Disable automatic compilation of Python files in /usr/share/rpmlint
- Fix non-ghost-in-run filter in config
* Tue Jun 12 2018 Miro Hrončok <mhroncok@redhat.com> - 1.10-14
- apply upstream fix for python 3.7 new magic numbers
* Sat Jun 2 2018 Tom Callaway <spot@fedoraproject.org> 1.10-13
- apply upstream fix for python 3.7 mtime handling
* Thu May 03 2018 Todd Zullinger <tmz@pobox.com> - 1.10-12
- Properly handle the exception on missing files (bz1574509)
- Explicitly disable the non-standard-group check
* Wed Apr 18 2018 Todd Zullinger <tmz@pobox.com>
- Ignore 'no-documentation' in debugsource packages
- Ignore /usr/src/debug/ in debugsource packages
* Tue Apr 17 2018 Tom Callaway <spot@fedoraproject.org> - 1.10-11 * Tue Apr 17 2018 Tom Callaway <spot@fedoraproject.org> - 1.10-11
- disable library-without-ldconfig-postin/postun checks (F28+) - disable library-without-ldconfig-postin/postun checks (F28+)