forked from pool/rpmlint
- update to 1.11:
* Avoid exception on inaccessible scripts * Print out the error content on UnicodeError to make flake8 happy * Fix flake8 warning about missing space around operators * Use compressions when checking for backup files * Account for arch specific code in /usr/share * Check for installed libtool wrapper files * Check for missing optional dependencies * Consider gnome help for doc files * Check for noarch package with files in lib64 * Verify if description is longer than summary * Explicitly tell users how to set URL * Ignore pytest_cache directory * confusing-invalid-spec-name * Ignore orig/rej leftovers after patching * Reenable Travis testing against Fedora Rawhide * Check all sections that should not use %buildroot in them * Put in default buildroot value used by Fedora/openSUSE * Stricter interpreter check * Use compileall to avoid %buildroot to be in pyc * Drop deprecated config file usage, 0.88 is pretty old anyway * Adjust Version to not print outdated Copyright * Rework Travis checks against latest Centos and Fedora releases * Fix exception handling * Fix various flake8-import-order test regressions * Blacklist newer pycodestyle warnings * Fix compatibility with file 5.33+ * Python 3.7.0b5 magic number is 3394 * Update TagsCheck.py * pyc related tests: DRY OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=648
This commit is contained in:
parent
4f6987556b
commit
1d8d6856a8
@ -1,33 +0,0 @@
|
||||
From 534ce885e7a1529e0729dc0ae3ef75a64324583b Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sat, 21 Oct 2017 19:24:09 +0200
|
||||
Subject: [PATCH] Accept python(abi) as a valid versioned python dependency
|
||||
|
||||
On (open)SUSE the build environment properly generates a
|
||||
requires python(abi) = x.y, so accept that to silence the warning.
|
||||
---
|
||||
FilesCheck.py | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/FilesCheck.py b/FilesCheck.py
|
||||
index abb3fa7..2ece474 100644
|
||||
--- a/FilesCheck.py
|
||||
+++ b/FilesCheck.py
|
||||
@@ -717,10 +717,10 @@ class FilesCheck(AbstractCheck.AbstractCheck):
|
||||
|
||||
if not python_dep_error:
|
||||
res = python_regex.search(f)
|
||||
- if res and not (pkg.check_versioned_dep('python-base',
|
||||
- res.group(1)) or
|
||||
- pkg.check_versioned_dep('python',
|
||||
- res.group(1))):
|
||||
+ if (res and not
|
||||
+ any((pkg.check_versioned_dep(dep, res.group(1))
|
||||
+ for dep in (
|
||||
+ 'python', 'python-base', 'python(abi)')))):
|
||||
printError(pkg, 'no-dependency-on', 'python-base',
|
||||
res.group(1))
|
||||
python_dep_error = True
|
||||
--
|
||||
2.14.2
|
||||
|
@ -1,35 +0,0 @@
|
||||
From e090267a175d2f2d52128c780108835f36d1ef1e Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sun, 18 Feb 2018 15:23:39 +0100
|
||||
Subject: [PATCH] Always import XDG desktop files as utf8
|
||||
|
||||
Don't rely on them being entirely ASCII or the system
|
||||
locale.
|
||||
---
|
||||
MenuXDGCheck.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/MenuXDGCheck.py b/MenuXDGCheck.py
|
||||
index 66912ea..d4418a9 100644
|
||||
--- a/MenuXDGCheck.py
|
||||
+++ b/MenuXDGCheck.py
|
||||
@@ -6,6 +6,7 @@
|
||||
# http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-latest.html
|
||||
#
|
||||
|
||||
+import codecs
|
||||
import os
|
||||
try:
|
||||
import ConfigParser as cfgparser
|
||||
@@ -30,7 +31,7 @@ class MenuXDGCheck(AbstractCheck.AbstractFilesCheck):
|
||||
def parse_desktop_file(self, pkg, root, f, filename):
|
||||
cfp = cfgparser.RawConfigParser()
|
||||
try:
|
||||
- with open(f, 'rb') as inputf:
|
||||
+ with codecs.open(f, encoding='utf-8') as inputf:
|
||||
cfp.readfp(inputf, filename)
|
||||
except cfgparser.DuplicateSectionError as e:
|
||||
printError(
|
||||
--
|
||||
2.16.1
|
||||
|
@ -1,39 +0,0 @@
|
||||
From 49611f900047d5397ebbbdb0ed5299580337ea34 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Wed, 1 Nov 2017 13:59:01 +0100
|
||||
Subject: [PATCH] Avoid calling close on undefined fd variable
|
||||
|
||||
It can happen that open did through an OSError but then the
|
||||
corresponding close UnknownVariableError wasn't caught. we
|
||||
can fix that by putting both in the same try/exception block,
|
||||
which also cleans up the code a bit.
|
||||
---
|
||||
Pkg.py | 9 ++-------
|
||||
1 file changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/Pkg.py b/Pkg.py
|
||||
index 47197c9..2622f9a 100644
|
||||
--- a/Pkg.py
|
||||
+++ b/Pkg.py
|
||||
@@ -719,16 +719,11 @@ class Pkg(AbstractPkg):
|
||||
# use descriptor() method instead
|
||||
try:
|
||||
fd = os.open(pkgfile.path, os.O_RDONLY)
|
||||
- except OSError:
|
||||
- if not pkgfile.is_ghost:
|
||||
- raise
|
||||
- else:
|
||||
pkgfile.magic = b2s(_magic.descriptor(fd))
|
||||
- # libmagic up to 5.18 already closes the descriptor
|
||||
- try:
|
||||
os.close(fd)
|
||||
except OSError:
|
||||
- pass
|
||||
+ if not pkgfile.is_ghost:
|
||||
+ raise
|
||||
if pkgfile.magic is None:
|
||||
pkgfile.magic = ''
|
||||
elif Pkg._magic_from_compressed_re.search(pkgfile.magic):
|
||||
--
|
||||
2.14.2
|
||||
|
@ -1,28 +0,0 @@
|
||||
From 5a0f99a9f522944a0933cd06f9010a96bef9b7b3 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Tue, 10 Oct 2017 11:02:57 +0200
|
||||
Subject: [PATCH] Avoid false positives on is_elf check
|
||||
|
||||
"symbolic link to `SELF-WE-PD-XXL.wings'"
|
||||
|
||||
matched the "ELF" in magic logic. So make it more strict
|
||||
by enforcing that the magic needs to start with "ELF "
|
||||
which seems to match everywhere (PIE executables, normal
|
||||
executables, ELF libs).
|
||||
---
|
||||
BinariesCheck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -372,7 +372,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
(fname.startswith("/usr/lib64") or fname.startswith("/lib64")):
|
||||
file_in_lib64 = True
|
||||
|
||||
- is_elf = 'ELF' in pkgfile.magic
|
||||
+ is_elf = pkgfile.magic.startswith('ELF ')
|
||||
is_ar = 'current ar archive' in pkgfile.magic
|
||||
is_ocaml_native = 'Objective caml native' in pkgfile.magic
|
||||
is_lua_bytecode = 'Lua bytecode' in pkgfile.magic
|
@ -1,66 +0,0 @@
|
||||
From 790482dbc83f6cd67d29697ce6904dfc962bf576 Mon Sep 17 00:00:00 2001
|
||||
From: marxin <mliska@suse.cz>
|
||||
Date: Wed, 2 Jan 2019 13:22:40 +0100
|
||||
Subject: [PATCH] Backport d8f423b575e8be387d33bc3af176baf978efacbb:
|
||||
|
||||
Come up with lto-bytecode check for ELF files.
|
||||
---
|
||||
BinariesCheck.py | 14 +++++++++++++-
|
||||
.../libreiserfscore-devel-3.6.27-0.x86_64.rpm | Bin 0 -> 1005964 bytes
|
||||
test/test_binaries.py | 5 +++++
|
||||
3 files changed, 18 insertions(+), 1 deletion(-)
|
||||
create mode 100644 test/binary/libreiserfscore-devel-3.6.27-0.x86_64.rpm
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -71,6 +71,7 @@ class BinaryInfo(object):
|
||||
|
||||
chdir_call_regex = create_regexp_call('chdir')
|
||||
mktemp_call_regex = create_regexp_call('mktemp')
|
||||
+ lto_section_name_prefix = '.gnu.lto_.'
|
||||
|
||||
def __init__(self, pkg, path, file, is_ar, is_shlib):
|
||||
self.readelf_error = False
|
||||
@@ -90,6 +91,7 @@ class BinaryInfo(object):
|
||||
self.debuginfo = False
|
||||
self.symtab = False
|
||||
self.tail = ''
|
||||
+ self.lto_sections = False
|
||||
|
||||
self.setgid = False
|
||||
self.setuid = False
|
||||
@@ -116,6 +118,9 @@ class BinaryInfo(object):
|
||||
if not res[0]:
|
||||
lines = res[1].splitlines()
|
||||
for l in lines:
|
||||
+ if BinaryInfo.lto_section_name_prefix in l:
|
||||
+ self.lto_sections = True
|
||||
+
|
||||
r = BinaryInfo.needed_regex.search(l)
|
||||
if r:
|
||||
self.needed.append(r.group(1))
|
||||
@@ -513,6 +518,9 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
for ec in bin_info.exit_calls:
|
||||
printWarning(pkg, 'shared-lib-calls-exit', fname, ec)
|
||||
|
||||
+ if bin_info.lto_sections:
|
||||
+ printError(pkg, 'lto-bytecode', fname)
|
||||
+
|
||||
for ec in bin_info.forbidden_calls:
|
||||
printWarning(pkg, ec, fname,
|
||||
BinaryInfo.forbidden_functions[ec]['f_name'])
|
||||
@@ -835,7 +843,11 @@ upstream to have this issue fixed.''',
|
||||
'''This executable should be stripped from debugging symbols, in order to take
|
||||
less space and be loaded faster. This is usually done automatically at
|
||||
buildtime by rpm. Check the build logs and the permission on the file (some
|
||||
-implementations only strip if the permission is 0755).'''
|
||||
+implementations only strip if the permission is 0755).''',
|
||||
+
|
||||
+'lto-bytecode',
|
||||
+'''This executable contains a LTO section. LTO bytecode is not portable
|
||||
+and should not be distributed in static libraries or e.g. Python modules.''',
|
||||
)
|
||||
|
||||
# BinariesCheck.py ends here
|
@ -1,77 +0,0 @@
|
||||
From 5237c197f56698d55fd1d18f8127f6e947350d80 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Stefan=20Br=C3=BCns?= <stefan.bruens@rwth-aachen.de>
|
||||
Date: Wed, 11 Oct 2017 16:29:21 +0200
|
||||
Subject: [PATCH] Binariescheck: Check for chroot/chdir on ARM, PPC
|
||||
|
||||
The assembly on ARM looks almost the same as the x86 assembly, but
|
||||
with a branch mnemonic (bl) instead of an explicit call.
|
||||
|
||||
On PPC, library function calls use jump tables, so the vicinity check does
|
||||
not work, but we can at least detect a sole chroot without chdir.
|
||||
---
|
||||
BinariesCheck.py | 28 +++++++++++++++++++---------
|
||||
1 file changed, 19 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/BinariesCheck.py b/BinariesCheck.py
|
||||
index bd75558..8d224a8 100644
|
||||
--- a/BinariesCheck.py
|
||||
+++ b/BinariesCheck.py
|
||||
@@ -54,8 +54,6 @@ class BinaryInfo(object):
|
||||
setuid_call_regex = create_regexp_call(r'set(?:res|e)?uid')
|
||||
setgroups_call_regex = create_regexp_call(r'(?:ini|se)tgroups')
|
||||
chroot_call_regex = create_regexp_call('chroot')
|
||||
- # 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
|
||||
- objdump_call_regex = re.compile(br'callq?\s(.*)')
|
||||
debuginfo_regex = re.compile(r'^\s+\[\s*\d+\]\s+\.debug_.*\s+')
|
||||
symtab_regex = re.compile(r'^\s+\[\s*\d+\]\s+\.symtab\s+')
|
||||
gethostbyname_call_regex = create_regexp_call(r'(gethostbyname|gethostbyname2|gethostbyaddr|gethostbyname_r|gethostbyname2_r|gethostbyaddr_r)')
|
||||
@@ -96,6 +94,16 @@ class BinaryInfo(object):
|
||||
self.mktemp = False
|
||||
|
||||
is_debug = path.endswith('.debug')
|
||||
+ # Currently this implementation works only on specific
|
||||
+ # architectures due to reliance on arch specific assembly.
|
||||
+ if pkg.arch in ['armv6hl', 'armv7hl', 'aarch64']:
|
||||
+ # 10450: ebffffec bl 10408 <chroot@plt>
|
||||
+ BinaryInfo.objdump_call_regex = re.compile(br'\sbl\s+(.*)')
|
||||
+ elif (pkg.arch.endswith('86') or pkg.arch == 'x86_64'):
|
||||
+ # 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
|
||||
+ BinaryInfo.objdump_call_regex = re.compile(br'callq?\s(.*)')
|
||||
+ else:
|
||||
+ BinaryInfo.objdump_call_regex = None
|
||||
|
||||
res = Pkg.getstatusoutput(
|
||||
('readelf', '-W', '-S', '-l', '-d', '-s', path))
|
||||
@@ -204,10 +212,13 @@ class BinaryInfo(object):
|
||||
|
||||
# check if chroot is near chdir (since otherwise, chroot is called
|
||||
# without chdir)
|
||||
- # Currently this implementation works only on x86_64 due to reliance
|
||||
- # on x86_64 specific assembly. Skip it on other architectures
|
||||
- if ((pkg.arch.endswith('86') or pkg.arch == 'x86_64') and
|
||||
- self.chroot and self.chdir):
|
||||
+ if not BinaryInfo.objdump_call_regex and self.chroot and self.chdir:
|
||||
+ # On some architectures, e.g. PPC, it is to difficult to
|
||||
+ # find the actual invocations of chroot/chdir, if both
|
||||
+ # exist assume chroot is fine
|
||||
+ self.chroot_near_chdir = True
|
||||
+
|
||||
+ elif self.chroot and self.chdir:
|
||||
p = subprocess.Popen(('objdump', '-d', path),
|
||||
stdout=subprocess.PIPE, bufsize=-1,
|
||||
env=dict(os.environ, LC_ALL="C"))
|
||||
@@ -537,9 +548,8 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
|
||||
printError(pkg, 'missing-call-to-setgroups-before-setuid',
|
||||
fname)
|
||||
|
||||
- if ((pkg.arch.endswith('86') or pkg.arch == 'x86_64') and bin_info.chroot):
|
||||
- if not bin_info.chdir or not bin_info.chroot_near_chdir:
|
||||
- printError(pkg, 'missing-call-to-chdir-with-chroot', fname)
|
||||
+ if bin_info.chroot and not bin_info.chroot_near_chdir:
|
||||
+ printError(pkg, 'missing-call-to-chdir-with-chroot', fname)
|
||||
|
||||
if bin_info.mktemp:
|
||||
printError(pkg, 'call-to-mktemp', fname)
|
||||
--
|
||||
2.14.2
|
||||
|
@ -1,34 +0,0 @@
|
||||
From 9140901be1ab2c41df6ec7b21bd68e2e695b201f Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Thu, 28 Sep 2017 23:59:34 +0200
|
||||
Subject: [PATCH] Execute chroot tests also on x86 rpms
|
||||
|
||||
x86 and x86_64 are reasonably similar, so this is safe
|
||||
to do.
|
||||
---
|
||||
BinariesCheck.py | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -223,7 +223,8 @@ class BinaryInfo(object):
|
||||
# without chdir)
|
||||
# Currently this implementation works only on x86_64 due to reliance
|
||||
# on x86_64 specific assembly. Skip it on other architectures
|
||||
- if pkg.arch == 'x86_64' and self.chroot and self.chdir:
|
||||
+ if ((pkg.arch.endswith('86') or pkg.arch == 'x86_64') and
|
||||
+ self.chroot and self.chdir):
|
||||
p = subprocess.Popen(('objdump', '-d', path),
|
||||
stdout=subprocess.PIPE, bufsize=-1,
|
||||
env=dict(os.environ, LC_ALL="C"))
|
||||
@@ -578,7 +579,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
printError(pkg, 'missing-call-to-setgroups-before-setuid',
|
||||
fname)
|
||||
|
||||
- if pkg.arch == 'x86_64' and bin_info.chroot:
|
||||
+ if ((pkg.arch.endswith('86') or pkg.arch == 'x86_64') and bin_info.chroot):
|
||||
if not bin_info.chdir or not bin_info.chroot_near_chdir:
|
||||
printError(pkg, 'missing-call-to-chdir-with-chroot', fname)
|
||||
|
@ -1,44 +0,0 @@
|
||||
From 1d70b641e5f755de72b0fa0059d4979a79f9553c Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Thu, 28 Sep 2017 22:16:30 +0200
|
||||
Subject: [PATCH 1/3] Extend scm_regex to capture more SCM system files
|
||||
|
||||
Also add unit test coverage for it.
|
||||
---
|
||||
FilesCheck.py | 4 +++-
|
||||
test/test_files.py | 10 ++++++++++
|
||||
2 files changed, 13 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -202,7 +202,9 @@ ldconfig_regex = re.compile(r'^[^#]*ldco
|
||||
depmod_regex = re.compile(r'^[^#]*depmod', re.MULTILINE)
|
||||
install_info_regex = re.compile(r'^[^#]*install-info', re.MULTILINE)
|
||||
perl_temp_file_regex = re.compile(r'.*perl.*/(\.packlist|perllocal\.pod)$')
|
||||
-scm_regex = re.compile(r'/CVS/[^/]+$|/\.(bzr|cvs|git|hg)ignore$|/\.hgtags$|/\.(bzr|git|hg|svn)/|/(\.arch-ids|{arch})/')
|
||||
+scm_regex = re.compile(
|
||||
+ r'/(?:RCS|CVS)/[^/]+$|/\.(?:bzr|cvs|git|hg|svn)ignore$|'
|
||||
+ r',v$|/\.hgtags$|/\.(?:bzr|git|hg|svn)/|/(?:\.arch-ids|{arch})/')
|
||||
games_path_regex = re.compile(r'^/usr(/lib(64)?)?/games/')
|
||||
games_group_regex = re.compile(Config.getOption('RpmGamesGroups', DEFAULT_GAMES_GROUPS))
|
||||
dangling_exceptions = Config.getOption('DanglingSymlinkExceptions', DEFAULT_DANGLING_EXCEPTIONS)
|
||||
Index: rpmlint-rpmlint-1.10/test/test_files.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/test/test_files.py
|
||||
+++ rpmlint-rpmlint-1.10/test/test_files.py
|
||||
@@ -52,3 +52,13 @@ def test_script_interpreter():
|
||||
assert se(b"#! /usr/bin/perl -wT \n") == ("/usr/bin/perl", "-wT")
|
||||
assert se(b"#!/usr/bin/env python3 foo") == ("/usr/bin/env", "python3 foo")
|
||||
assert se(b"# something here\n#!not a shebang") == (None, "")
|
||||
+
|
||||
+
|
||||
+def test_scm_regex():
|
||||
+ from FilesCheck import scm_regex
|
||||
+
|
||||
+ assert scm_regex.search('/foo/CVS/bar')
|
||||
+ assert scm_regex.search('/foo/RCS/bar')
|
||||
+ assert scm_regex.search('/bar/foo,v')
|
||||
+ assert scm_regex.search('bar/.svnignore')
|
||||
+ assert scm_regex.search('bar/.git/refs')
|
@ -1,42 +0,0 @@
|
||||
From 6497ac4806c2178a19d23203016cbdb6f7f45825 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Tue, 3 Jul 2018 14:24:01 +0200
|
||||
Subject: [PATCH] Fix compatibility with file 5.33+
|
||||
|
||||
In file 5.33 the pkgfile magic output for pie executables changed
|
||||
from
|
||||
|
||||
ELF 64-bit LSB shared object
|
||||
|
||||
to
|
||||
|
||||
ELF 64-bit LSB pie executable x86-64
|
||||
|
||||
So we need to treat "pie executable" as an equivalent file magic
|
||||
type for the purpose of PIE executable detection.
|
||||
---
|
||||
BinariesCheck.py | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -525,6 +525,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
|
||||
is_exec = 'executable' in pkgfile.magic
|
||||
is_shobj = 'shared object' in pkgfile.magic
|
||||
+ is_pie_exec = 'pie executable' in pkgfile.magic
|
||||
|
||||
if not is_exec and not is_shobj:
|
||||
continue
|
||||
@@ -542,7 +543,8 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
if ocaml_mixed_regex.search(bin_info.tail):
|
||||
printWarning(pkg, 'ocaml-mixed-executable', fname)
|
||||
|
||||
- if not is_shobj and pie_exec_re and pie_exec_re.search(fname):
|
||||
+ if ((not is_shobj and not is_pie_exec) and
|
||||
+ pie_exec_re and pie_exec_re.search(fname)):
|
||||
printError(pkg, 'non-position-independent-executable',
|
||||
fname)
|
||||
|
@ -1,120 +0,0 @@
|
||||
From 53b868fcaba87016c623f47e8d40e09f4fccaafa Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Wed, 4 Oct 2017 14:40:02 +0200
|
||||
Subject: [PATCH] Handle %post scripts that contain non-ascii characters
|
||||
|
||||
when running LC_ALL=C and python3 this otherwise traces with:
|
||||
|
||||
File "rpmlint/PostCheck.py", line 83, in check_syntax_script
|
||||
tmpfile.write(script)
|
||||
UnicodeEncodeError: 'ascii' codec can't encode character '\xfc' in position 16: ordinal not in range(128)
|
||||
|
||||
Add test coverage.
|
||||
---
|
||||
PostCheck.py | 31 +++++++++++++++++------------
|
||||
test/binary/Nonutfpostcheck-0-0.x86_64.rpm | Bin 0 -> 6028 bytes
|
||||
2 files changed, 18 insertions(+), 13 deletions(-)
|
||||
create mode 100644 test/binary/Nonutfpostcheck-0-0.x86_64.rpm
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/PostCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/PostCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/PostCheck.py
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
import os
|
||||
import re
|
||||
+import tempfile
|
||||
|
||||
import rpm
|
||||
|
||||
@@ -78,7 +79,8 @@ def check_syntax_script(prog, commandlin
|
||||
if not script:
|
||||
return False
|
||||
# TODO: test that "prog" is available/executable
|
||||
- tmpfile, tmpname = Pkg.mktemp()
|
||||
+ tmpfd, tmpname = tempfile.mkstemp(prefix='rpmlint.')
|
||||
+ tmpfile = os.fdopen(tmpfd, 'wb')
|
||||
try:
|
||||
tmpfile.write(script)
|
||||
tmpfile.close()
|
||||
@@ -105,35 +107,38 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
prog = pkg.scriptprog(tag[1])
|
||||
if prog:
|
||||
prog = prog.split()[0]
|
||||
- self.check_aux(pkg, files, prog, script, tag[2], prereq)
|
||||
+ self.check_aux(pkg, files, prog, pkg.header[tag[0]],
|
||||
+ tag[2], prereq)
|
||||
else:
|
||||
prog = pkg[tag[1]]
|
||||
for idx in range(0, len(prog)):
|
||||
self.check_aux(
|
||||
- pkg, files, prog[idx], script[idx], tag[2], prereq)
|
||||
+ pkg, files, prog[idx],
|
||||
+ pkg.header[tag[0]][idx], tag[2], prereq)
|
||||
|
||||
def check_aux(self, pkg, files, prog, script, tag, prereq):
|
||||
if script:
|
||||
+ script_str = Pkg.b2s(script)
|
||||
if prog:
|
||||
if prog not in valid_shells:
|
||||
printError(pkg, 'invalid-shell-in-' + tag, prog)
|
||||
if prog in empty_shells:
|
||||
printError(pkg, 'non-empty-' + tag, prog)
|
||||
if prog in syntaxcheck_shells or prog == '/usr/bin/perl':
|
||||
- if percent_regex.search(script):
|
||||
+ if percent_regex.search(script_str):
|
||||
printWarning(pkg, 'percent-in-' + tag)
|
||||
- if bracket_regex.search(script):
|
||||
+ if bracket_regex.search(script_str):
|
||||
printWarning(pkg, 'spurious-bracket-in-' + tag)
|
||||
- res = dangerous_command_regex.search(script)
|
||||
+ res = dangerous_command_regex.search(script_str)
|
||||
if res:
|
||||
printWarning(pkg, 'dangerous-command-in-' + tag,
|
||||
res.group(2))
|
||||
- res = selinux_regex.search(script)
|
||||
+ res = selinux_regex.search(script_str)
|
||||
if res:
|
||||
printError(pkg, 'forbidden-selinux-command-in-' + tag,
|
||||
res.group(2))
|
||||
|
||||
- if 'update-menus' in script:
|
||||
+ if 'update-menus' in script_str:
|
||||
menu_error = True
|
||||
for f in files:
|
||||
if menu_regex.search(f):
|
||||
@@ -142,10 +147,10 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
if menu_error:
|
||||
printError(pkg, 'update-menus-without-menu-file-in-' +
|
||||
tag)
|
||||
- if tmp_regex.search(script):
|
||||
+ if tmp_regex.search(script_str):
|
||||
printError(pkg, 'use-tmp-in-' + tag)
|
||||
for c in prereq_assoc:
|
||||
- if c[0].search(script):
|
||||
+ if c[0].search(script_str):
|
||||
found = False
|
||||
for p in c[1]:
|
||||
if p in prereq or p in files:
|
||||
@@ -157,9 +162,9 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
if prog in syntaxcheck_shells:
|
||||
if incorrect_shell_script(prog, script):
|
||||
printError(pkg, 'shell-syntax-error-in-' + tag)
|
||||
- if home_regex.search(script):
|
||||
+ if home_regex.search(script_str):
|
||||
printError(pkg, 'use-of-home-in-' + tag)
|
||||
- res = bogus_var_regex.search(script)
|
||||
+ res = bogus_var_regex.search(script_str)
|
||||
if res:
|
||||
printWarning(pkg, 'bogus-variable-use-in-' + tag,
|
||||
res.group(1))
|
||||
@@ -168,7 +173,7 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
if incorrect_perl_script(prog, script):
|
||||
printError(pkg, 'perl-syntax-error-in-' + tag)
|
||||
elif prog.endswith('sh'):
|
||||
- res = single_command_regex.search(script)
|
||||
+ res = single_command_regex.search(script_str)
|
||||
if res:
|
||||
printWarning(pkg, 'one-line-command-in-' + tag,
|
||||
res.group(1))
|
@ -1,130 +0,0 @@
|
||||
From 8de78fa8b0cd9a2fe4156b841429ac8d55b39909 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Fri, 29 Sep 2017 09:12:33 +0200
|
||||
Subject: [PATCH] Improve XDG Menu checks stability
|
||||
|
||||
Running RawConfigParser on untrusted input can cause a lot
|
||||
of exceptions. Handle them gracefully and raise appropriate
|
||||
rpmlint errors. Also separate the code a little and cleaning it up.
|
||||
---
|
||||
MenuXDGCheck.py | 84 ++++++++++++++++++++++++++----------
|
||||
test/binary/menuxdg1-0-0.noarch.rpm | Bin 0 -> 6555 bytes
|
||||
test/test_menuxdg.py | 17 ++++++++
|
||||
3 files changed, 78 insertions(+), 23 deletions(-)
|
||||
create mode 100644 test/binary/menuxdg1-0-0.noarch.rpm
|
||||
create mode 100644 test/test_menuxdg.py
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/MenuXDGCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/MenuXDGCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/MenuXDGCheck.py
|
||||
@@ -8,9 +8,9 @@
|
||||
|
||||
import os
|
||||
try:
|
||||
- from ConfigParser import RawConfigParser
|
||||
-except:
|
||||
- from configparser import RawConfigParser
|
||||
+ import ConfigParser as cfgparser
|
||||
+except ImportError:
|
||||
+ import configparser as cfgparser
|
||||
|
||||
import AbstractCheck
|
||||
from Filter import addDetails, printError, printWarning
|
||||
@@ -25,7 +25,52 @@ class MenuXDGCheck(AbstractCheck.Abstrac
|
||||
# $ echo $XDG_DATA_DIRS/applications
|
||||
# /var/lib/menu-xdg:/usr/share
|
||||
AbstractCheck.AbstractFilesCheck.__init__(
|
||||
- self, "MenuXDGCheck", r"/usr/share/applications/.*\.desktop$")
|
||||
+ self, "MenuXDGCheck", r'(?:/usr|/etc/opt|/opt/.*)/share/applications/.*\.desktop$')
|
||||
+
|
||||
+ def parse_desktop_file(self, pkg, root, f, filename):
|
||||
+ cfp = cfgparser.RawConfigParser()
|
||||
+ try:
|
||||
+ with open(f, 'rb') as inputf:
|
||||
+ cfp.readfp(inputf, filename)
|
||||
+ except cfgparser.DuplicateSectionError as e:
|
||||
+ printError(
|
||||
+ pkg, 'desktopfile-duplicate-section', filename,
|
||||
+ '[%s]' % e.section)
|
||||
+ except cfgparser.MissingSectionHeaderError:
|
||||
+ printError(
|
||||
+ pkg, 'desktopfile-missing-header', filename)
|
||||
+ except cfgparser.Error as e:
|
||||
+ # Only in Python >= 3.2
|
||||
+ if (hasattr(cfgparser, 'DuplicateOptionError') and
|
||||
+ isinstance(e, cfgparser.DuplicateOptionError)):
|
||||
+ printError(
|
||||
+ pkg, 'desktopfile-duplicate-option', filename,
|
||||
+ '[%s]/%s' % (e.section, e.option))
|
||||
+ else:
|
||||
+ printWarning(
|
||||
+ pkg, 'invalid-desktopfile', filename,
|
||||
+ e.message.partition(':')[0])
|
||||
+ except UnicodeDecodeError as e:
|
||||
+ printWarning(
|
||||
+ pkg, 'invalid-desktopfile', filename, 'No valid Unicode')
|
||||
+ else:
|
||||
+ binary = None
|
||||
+ if cfp.has_option('Desktop Entry', 'Exec'):
|
||||
+ binary = cfp.get('Desktop Entry', 'Exec').partition(' ')[0]
|
||||
+ if binary:
|
||||
+ found = False
|
||||
+ if binary.startswith('/'):
|
||||
+ found = os.path.exists(root + binary)
|
||||
+ else:
|
||||
+ for i in STANDARD_BIN_DIRS:
|
||||
+ if os.path.exists(root + i + '/' + binary):
|
||||
+ # no need to check if the binary is +x, rpmlint does it
|
||||
+ # in another place
|
||||
+ found = True
|
||||
+ break
|
||||
+ if not found:
|
||||
+ printWarning(
|
||||
+ pkg, 'desktopfile-without-binary', filename, binary)
|
||||
|
||||
def check_file(self, pkg, filename):
|
||||
root = pkg.dirName()
|
||||
@@ -43,25 +88,7 @@ class MenuXDGCheck(AbstractCheck.Abstrac
|
||||
if not is_utf8(f):
|
||||
printError(pkg, 'non-utf8-desktopfile', filename)
|
||||
|
||||
- cfp = RawConfigParser()
|
||||
- cfp.read(f)
|
||||
- binary = None
|
||||
- if cfp.has_option('Desktop Entry', 'Exec'):
|
||||
- binary = cfp.get('Desktop Entry', 'Exec').split(' ', 1)[0]
|
||||
- if binary:
|
||||
- found = False
|
||||
- if binary.startswith('/'):
|
||||
- found = os.path.exists(root + binary)
|
||||
- else:
|
||||
- for i in STANDARD_BIN_DIRS:
|
||||
- if os.path.exists(root + i + binary):
|
||||
- # no need to check if the binary is +x, rpmlint does it
|
||||
- # in another place
|
||||
- found = True
|
||||
- break
|
||||
- if not found:
|
||||
- printWarning(pkg, 'desktopfile-without-binary', filename,
|
||||
- binary)
|
||||
+ self.parse_desktop_file(pkg, root, f, filename)
|
||||
|
||||
|
||||
check = MenuXDGCheck()
|
||||
@@ -76,4 +103,15 @@ addDetails(
|
||||
'desktopfile-without-binary',
|
||||
'''the .desktop file is for a file not present in the package. You
|
||||
should check the requires or see if this is not a error''',
|
||||
+
|
||||
+'desktopfile-duplicate-section',
|
||||
+'''The .desktop file contains the mentioned section name twice, which
|
||||
+can trigger parsing ambiguities. Remove the duplicate.''',
|
||||
+
|
||||
+'desktopfile-duplicate-option',
|
||||
+'''The .desktop file contains the mentioned option key twice,
|
||||
+which can trigger parsing ambiguities. Remove the duplicate.''',
|
||||
+
|
||||
+'desktopfile-missing-header',
|
||||
+'''The .desktop file should start with a section header.''',
|
||||
)
|
@ -1,32 +0,0 @@
|
||||
From 3433a3cc77a05af3a7e0588899f61028b5546e64 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sun, 1 Oct 2017 14:00:26 +0200
|
||||
Subject: [PATCH] Tighten wrong-script-interpreter check to lower false
|
||||
positives
|
||||
|
||||
The check wasn't looking if the file is actually marked as
|
||||
executable or in one of the known-scripts-only directories. Without
|
||||
this patch, the check will fire on documentation examples that
|
||||
just happen to be detected as script, but where the shebang
|
||||
isn't actually captured by the find_requires rpm scripts. Omit
|
||||
warning about those, as there are more likely legitimate reasons.
|
||||
---
|
||||
FilesCheck.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -861,7 +861,10 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
elif interpreter or mode_is_exec or script_regex.search(f):
|
||||
if interpreter:
|
||||
res = interpreter_regex.search(interpreter)
|
||||
- if (res and res.group(1) == 'env') or not res:
|
||||
+ is_wrong_interpreter = (not res or (res and
|
||||
+ res.group(1) == 'env'))
|
||||
+ if ((mode_is_exec or script_regex.search(f)) and
|
||||
+ is_wrong_interpreter):
|
||||
printError(pkg, 'wrong-script-interpreter',
|
||||
f, interpreter, interpreter_args)
|
||||
elif not nonexec_file and not \
|
@ -1,62 +0,0 @@
|
||||
From a4618650898aece5c4838e71853310b54f6e29fa Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sun, 1 Oct 2017 22:08:20 +0200
|
||||
Subject: [PATCH] split wrong-script-interpreter into env-script-interpreter
|
||||
|
||||
For mere mortals, details message for wrong-script-interpreter
|
||||
does not explain why the env as shebang is an issue. Splitting
|
||||
that case into a separate diagnostic allows a more detailed
|
||||
info message alongside that gives a better rationale.
|
||||
---
|
||||
FilesCheck.py | 32 ++++++++++++++++++++++++++------
|
||||
1 file changed, 26 insertions(+), 6 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -863,12 +863,15 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
elif interpreter or mode_is_exec or script_regex.search(f):
|
||||
if interpreter:
|
||||
res = interpreter_regex.search(interpreter)
|
||||
- is_wrong_interpreter = (not res or (res and
|
||||
- res.group(1) == 'env'))
|
||||
- if ((mode_is_exec or script_regex.search(f)) and
|
||||
- is_wrong_interpreter):
|
||||
- printError(pkg, 'wrong-script-interpreter',
|
||||
- f, interpreter, interpreter_args)
|
||||
+ if (mode_is_exec or script_regex.search(f)):
|
||||
+ if res and res.group(1) == 'env':
|
||||
+ printError(pkg, 'env-script-interpreter',
|
||||
+ f, interpreter,
|
||||
+ interpreter_args)
|
||||
+ elif not res:
|
||||
+ printError(pkg, 'wrong-script-interpreter',
|
||||
+ f, interpreter,
|
||||
+ interpreter_args)
|
||||
elif not nonexec_file and not \
|
||||
(lib_path_regex.search(f) and
|
||||
f.endswith('.la')):
|
||||
@@ -1303,6 +1306,22 @@ Alternatively, if the file isn't suppose
|
||||
it is not marked as being executable.
|
||||
''',
|
||||
|
||||
+'env-script-interpreter',
|
||||
+'''This script uses 'env' as an interpreter.
|
||||
+For the rpm runtime dependency detection to work, the shebang
|
||||
+#!/usr/bin/env python
|
||||
+
|
||||
+needs to be patched into
|
||||
+#!/usr/bin/python
|
||||
+
|
||||
+otherwise the package dependency generator merely adds a dependency
|
||||
+on /usr/bin/env rather than the actual interpreter /usr/bin/python.
|
||||
+
|
||||
+Alternatively, if the file should not be executed, then ensure that
|
||||
+it is not marked as executable or don't install it in a path that
|
||||
+is reserved for executables.
|
||||
+''',
|
||||
+
|
||||
'non-executable-script',
|
||||
'''This text file contains a shebang or is located in a path dedicated for
|
||||
executables, but lacks the executable bits and cannot thus be executed. If
|
@ -1,52 +0,0 @@
|
||||
From bcc9a315dae3aacf27854f16328c59e32eab2816 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Thu, 28 Sep 2017 23:04:22 +0200
|
||||
Subject: [PATCH 3/3] Tighten lib_regex to avoid false positive in python
|
||||
bindings
|
||||
|
||||
Also add unit test coverage for it.
|
||||
---
|
||||
FilesCheck.py | 2 +-
|
||||
test/test_files.py | 17 +++++++++++++++++
|
||||
2 files changed, 18 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -197,7 +197,7 @@ devel_regex = re.compile(r'(.*)-(debug(i
|
||||
debuginfo_package_regex = re.compile(r'-debug(info)?$')
|
||||
debugsource_package_regex = re.compile(r'-debugsource$')
|
||||
use_debugsource = Config.getOption('UseDebugSource', False)
|
||||
-lib_regex = re.compile(r'lib(64)?/lib[^/]*(\.so\..*|-[0-9.]+\.so)')
|
||||
+lib_regex = re.compile(r'/lib(?:64)?/lib[^/]+(?:\.so\.[\d\.]+|-[\d\.]+\.so)$')
|
||||
ldconfig_regex = re.compile(r'^[^#]*ldconfig', re.MULTILINE)
|
||||
depmod_regex = re.compile(r'^[^#]*depmod', re.MULTILINE)
|
||||
install_info_regex = re.compile(r'^[^#]*install-info', re.MULTILINE)
|
||||
Index: rpmlint-rpmlint-1.10/test/test_files.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/test/test_files.py
|
||||
+++ rpmlint-rpmlint-1.10/test/test_files.py
|
||||
@@ -62,3 +62,22 @@ def test_scm_regex():
|
||||
assert scm_regex.search('/bar/foo,v')
|
||||
assert scm_regex.search('bar/.svnignore')
|
||||
assert scm_regex.search('bar/.git/refs')
|
||||
+
|
||||
+
|
||||
+def test_lib_regex():
|
||||
+ from FilesCheck import lib_regex
|
||||
+
|
||||
+ # true matches
|
||||
+ assert all(
|
||||
+ lib_regex.search(x) for x in
|
||||
+ ('/lib/libnsl-2.26.so',
|
||||
+ '/usr/lib64/libgnomeui.so.3',
|
||||
+ '/lib64/libgcc_s.so.1'))
|
||||
+
|
||||
+ # false positives
|
||||
+ assert not any(
|
||||
+ lib_regex.search(x) for x in
|
||||
+ ('/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.4600.1-gdb.py',
|
||||
+ '/usr/share/doc/findlib/lib-1.0.so',
|
||||
+ '/usr/lib64/libvulkan_radeon.so',
|
||||
+ '/usr/lib64/rsocket/binary',))
|
@ -1,47 +0,0 @@
|
||||
From 33b3aab641f6f71f33fd87f1e1b41ea2e74f48e3 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sun, 1 Oct 2017 14:36:40 +0200
|
||||
Subject: [PATCH] Validate Appdata also when appstream-util is unavailable
|
||||
|
||||
When the dependency isn't installed, we can at least still
|
||||
validate whether the input is valid XML or not. As we're
|
||||
not printing any validation results anyway this is good
|
||||
enough.
|
||||
---
|
||||
AppDataCheck.py | 14 ++++++++++----
|
||||
1 file changed, 10 insertions(+), 4 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/AppDataCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/AppDataCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/AppDataCheck.py
|
||||
@@ -10,6 +10,7 @@ import AbstractCheck
|
||||
import Config
|
||||
from Filter import addDetails, printError
|
||||
from Pkg import getstatusoutput
|
||||
+import xml.etree.ElementTree as ET
|
||||
|
||||
STANDARD_BIN_DIRS = ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/']
|
||||
DEFAULT_APPDATA_CHECKER = ('appstream-util', 'validate-relax')
|
||||
@@ -28,12 +29,18 @@ class AppDataCheck(AbstractCheck.Abstrac
|
||||
def check_file(self, pkg, filename):
|
||||
root = pkg.dirName()
|
||||
f = root + filename
|
||||
+ validation_failed = False
|
||||
try:
|
||||
st = getstatusoutput(appdata_checker + (f,))
|
||||
+ # Return code nonzero?
|
||||
+ validation_failed = (st[0] != 0)
|
||||
except OSError:
|
||||
- # ignore if the checker is not installed
|
||||
- return
|
||||
- if st[0]:
|
||||
+ # checker is not installed, do a validation manually
|
||||
+ try:
|
||||
+ ET.parse(pkg.dirName() + filename)
|
||||
+ except ET.ParseError:
|
||||
+ validation_failed = True
|
||||
+ if validation_failed:
|
||||
printError(pkg, 'invalid-appdata-file', filename)
|
||||
|
||||
|
@ -1,16 +0,0 @@
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -1278,7 +1278,10 @@ executed.''',
|
||||
|
||||
'wrong-script-interpreter',
|
||||
'''This script uses an interpreter which is either an inappropriate one
|
||||
-or located in an inappropriate directory for packaged system software.''',
|
||||
+or located in an inappropriate directory for packaged system software.
|
||||
+Alternatively, if the file isn't supposed to be executed, then ensure that
|
||||
+it is not marked as being executable.
|
||||
+''',
|
||||
|
||||
'non-executable-script',
|
||||
'''This text file contains a shebang or is located in a path dedicated for
|
@ -1,11 +0,0 @@
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -670,7 +670,7 @@ versions you can ignore this warning.'''
|
||||
|
||||
'hardcoded-path-in-buildroot-tag',
|
||||
'''A path is hardcoded in your Buildroot tag. It should be replaced
|
||||
-by something like %{_tmppath}/%name-root.''',
|
||||
+by %{_tmppath}/%{name}-%{version}-build.''',
|
||||
|
||||
'hardcoded-packager-tag',
|
||||
'''The Packager tag is hardcoded in your spec file. It should be removed, so
|
@ -1,13 +0,0 @@
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -235,7 +235,9 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||
|
||||
continue
|
||||
|
||||
- if current_section in ('prep', 'build') and \
|
||||
+ if current_section in ('prep', 'build','pre', 'post', 'postun',
|
||||
+ 'trigger', 'triggerin', 'triggerprein', 'triggerun', 'triggerpostun',
|
||||
+ 'pretrans', 'posttrans') and \
|
||||
contains_buildroot(line):
|
||||
printWarning(pkg, 'rpm-buildroot-usage', '%' + current_section,
|
||||
line[:-1].strip())
|
@ -6,20 +6,22 @@ Subject: [PATCH] check for self provides
|
||||
TagsCheck.py | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -891,6 +891,8 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
for p in pkg.provides():
|
||||
value = Pkg.formatRequire(*p)
|
||||
self._unexpanded_macros(pkg, 'Provides %s' % (value,), value)
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -874,6 +874,10 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
obs_names = [x[0] for x in pkg.obsoletes()]
|
||||
prov_names = [x[0].split(':/')[0] for x in pkg.provides()]
|
||||
|
||||
+ for p in pkg.provides():
|
||||
+ if p[0] == pkg.name and not p[1]:
|
||||
+ printError(pkg, 'unversioned-explicit-self-provides', p[0])
|
||||
|
||||
for c in pkg.conflicts():
|
||||
value = Pkg.formatRequire(*c)
|
||||
@@ -1215,6 +1217,10 @@ objects should thus not be depended on a
|
||||
+
|
||||
for o in (x for x in obs_names if x not in prov_names):
|
||||
printWarning(pkg, 'obsolete-not-provided', o)
|
||||
for o in pkg.obsoletes():
|
||||
@@ -1219,6 +1223,10 @@ objects should thus not be depended on a
|
||||
in the containing package. Get rid of the provides if appropriate, for example
|
||||
by filtering it out during build. Note that in some cases this may require
|
||||
disabling rpmbuild's internal dependency generator.''',
|
||||
|
@ -1,22 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:40 +0200
|
||||
Subject: [PATCH] compressed-backup-regex.diff
|
||||
|
||||
===================================================================
|
||||
---
|
||||
FilesCheck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -179,7 +179,7 @@ DEFAULT_DISALLOWED_DIRS = (
|
||||
)
|
||||
|
||||
sub_bin_regex = re.compile(r'^(/usr)?/s?bin/\S+/')
|
||||
-backup_regex = re.compile(r'(~|\#[^/]+\#|\.orig|\.rej)$')
|
||||
+backup_regex = re.compile(r'(~|\#[^/]+\#|\.orig|\.orig\.gz|\.rej)$')
|
||||
compr_regex = re.compile(r'\.(gz|z|Z|zip|bz2|lzma|xz)$')
|
||||
absolute_regex = re.compile(r'^/([^/]+)')
|
||||
absolute2_regex = re.compile(r'^/?([^/]+)')
|
@ -1,25 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:39 +0200
|
||||
Subject: [PATCH] confusing-invalid-spec-name
|
||||
|
||||
# Confusing message. The problem is not that the file does not end
|
||||
# with ".spec", but that there is a mismatch of specname and pkg name.
|
||||
---
|
||||
SpecCheck.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -644,8 +644,8 @@ addDetails(
|
||||
SPEC file to build a valid RPM package.''',
|
||||
|
||||
'invalid-spec-name',
|
||||
-'''Your spec filename must end with '.spec'. If it's not the case, rename your
|
||||
-file and rebuild your package.''',
|
||||
+'''The spec file name (without the .spec suffix) must match the package name
|
||||
+("Name:" tag). Either rename your package or the specfile.''',
|
||||
|
||||
'non-utf8-spec-file',
|
||||
'''The character encoding of the spec file is not UTF-8. Convert it for
|
@ -1,34 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:39 +0200
|
||||
Subject: [PATCH] description-check.diff
|
||||
|
||||
===================================================================
|
||||
---
|
||||
TagsCheck.py | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -736,6 +736,9 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
else:
|
||||
for lang in langs:
|
||||
self.check_description(pkg, lang, ignored_words)
|
||||
+
|
||||
+ if len(Pkg.b2s(pkg[rpm.RPMTAG_DESCRIPTION]).partition('Authors:')[0]) - 4 < len(pkg[rpm.RPMTAG_SUMMARY]):
|
||||
+ printWarning(pkg, 'description-shorter-than-summary')
|
||||
else:
|
||||
printError(pkg, 'no-description-tag')
|
||||
|
||||
@@ -1028,6 +1031,10 @@ Name tag.''',
|
||||
'''The major number of the library isn't included in the package's name.
|
||||
''',
|
||||
|
||||
+'description-shorter-than-summary',
|
||||
+'''The package description should be longer than the summary. be a bit more
|
||||
+verbose, please.''',
|
||||
+
|
||||
'no-provides',
|
||||
'''Your library package doesn't provide the -devel name without the major
|
||||
version included.''',
|
@ -7,11 +7,11 @@ Subject: [PATCH] devel-provide-is-devel-package.diff
|
||||
FilesCheck.py | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -422,6 +422,10 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
--- rpmlint-rpmlint-1.11.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
@@ -446,6 +446,10 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
# Check if the package is a development package
|
||||
devel_pkg = devel_regex.search(pkg.name)
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] docdata-examples.diff
|
||||
FilesCheck.py | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -189,6 +189,7 @@ bin_regex = re.compile(r'^/(?:usr/(?:s?b
|
||||
--- rpmlint-rpmlint-1.11.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
@@ -190,6 +190,7 @@ bin_regex = re.compile(r'^/(?:usr/(?:s?b
|
||||
includefile_regex = re.compile(r'\.(c|h)(pp|xx)?$', re.IGNORECASE)
|
||||
develfile_regex = re.compile(r'\.(a|cmxa?|mli?|gir)$')
|
||||
buildconfigfile_regex = re.compile(r'(\.pc|/bin/.+-config)$')
|
||||
@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
# room for improvement with catching more -R, but also for false positives...
|
||||
buildconfig_rpath_regex = re.compile(r'(?:-rpath|Wl,-R)\b')
|
||||
sofile_regex = re.compile(r'/lib(64)?/(.+/)?lib[^/]+\.so$')
|
||||
@@ -785,7 +786,7 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
@@ -820,7 +821,7 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
includefile_regex.search(f) or \
|
||||
develfile_regex.search(f) or \
|
||||
logrotate_regex.search(f)
|
||||
@ -28,7 +28,7 @@ Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
printWarning(pkg, 'spurious-executable-perm', f)
|
||||
elif f.startswith('/etc/') and f not in config_files and \
|
||||
f not in ghost_files:
|
||||
@@ -1154,7 +1155,10 @@ included in your package.''',
|
||||
@@ -1196,7 +1197,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
|
||||
|
@ -1,21 +0,0 @@
|
||||
Index: rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
import re
|
||||
import sys
|
||||
-import unicodedata
|
||||
try:
|
||||
from urlparse import urlparse
|
||||
except ImportError: # Python 3
|
||||
@@ -107,7 +106,7 @@ filelist_regex = re.compile(r'\s+-f\s+\S
|
||||
pkgname_regex = re.compile(r'\s+(?:-n\s+)?(\S+)')
|
||||
tarball_regex = re.compile(r'\.(?:t(?:ar|[glx]z|bz2?)|zip)\b', re.IGNORECASE)
|
||||
|
||||
-UNICODE_NBSP = unicodedata.lookup('NO-BREAK SPACE')
|
||||
+UNICODE_NBSP = u'\xa0'
|
||||
|
||||
|
||||
def unversioned(deps):
|
@ -7,11 +7,11 @@ Subject: [PATCH] extend-suse-conffiles-check.diff
|
||||
FilesCheck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -803,7 +803,7 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
--- rpmlint-rpmlint-1.11.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
@@ -828,7 +828,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 \
|
||||
|
@ -1,18 +0,0 @@
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -255,8 +255,11 @@ class BinaryInfo(object):
|
||||
|
||||
else:
|
||||
self.readelf_error = True
|
||||
- printWarning(pkg, 'binaryinfo-readelf-failed',
|
||||
- file, re.sub('\n.*', '', res[1]))
|
||||
+ # Go and others are producing ar archives that don't have ELF
|
||||
+ # headers, so don't complain about it
|
||||
+ if not is_ar:
|
||||
+ printWarning(pkg, 'binaryinfo-readelf-failed',
|
||||
+ file, re.sub('\n.*', '', res[1]))
|
||||
|
||||
try:
|
||||
with open(path, 'rb') as fobj:
|
@ -7,11 +7,11 @@ Subject: [PATCH] invalid-filerequires.diff
|
||||
TagsCheck.py | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -452,6 +452,7 @@ invalid_version_regex = re.compile(r'([0
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -456,6 +456,7 @@ invalid_version_regex = re.compile(r'([0
|
||||
# () are here for grouping purpose in the regexp
|
||||
forbidden_words_regex = re.compile(r'(%s)' % Config.getOption('ForbiddenWords'), re.IGNORECASE)
|
||||
valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost'))
|
||||
@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
use_epoch = Config.getOption('UseEpoch', False)
|
||||
use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT)
|
||||
max_line_len = Config.getOption('MaxLineLength', 79)
|
||||
@@ -632,6 +633,9 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
@@ -636,6 +637,9 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
if d[0].startswith('/usr/local/'):
|
||||
printError(pkg, 'invalid-dependency', d[0])
|
||||
|
||||
@ -29,7 +29,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
if is_source:
|
||||
if lib_devel_number_regex.search(d[0]):
|
||||
printError(pkg, 'invalid-build-requires', d[0])
|
||||
@@ -1162,6 +1166,12 @@ unneeded explicit Requires: tags.''',
|
||||
@@ -1166,6 +1170,12 @@ unneeded explicit Requires: tags.''',
|
||||
'''This package provides 2 times the same capacity. It should only provide it
|
||||
once.''',
|
||||
|
||||
|
@ -1,42 +0,0 @@
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -367,8 +367,21 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
is_ar = 'current ar archive' in pkgfile.magic
|
||||
is_ocaml_native = 'Objective caml native' in pkgfile.magic
|
||||
is_lua_bytecode = 'Lua bytecode' in pkgfile.magic
|
||||
+ is_shell = "shell script" in pkgfile.magic
|
||||
is_binary = is_elf or is_ar or is_ocaml_native or is_lua_bytecode
|
||||
|
||||
+ if is_shell:
|
||||
+ file_start = None
|
||||
+ try:
|
||||
+ with open(pkgfile.path, 'rb') as inputf:
|
||||
+ file_start = inputf.read(2048)
|
||||
+ except IOError:
|
||||
+ pass
|
||||
+ if (file_start and
|
||||
+ b'This wrapper script should never '
|
||||
+ b'be moved out of the build directory' in file_start):
|
||||
+ printError(pkg, 'libtool-wrapper-in-package', fname)
|
||||
+
|
||||
if not is_binary:
|
||||
if reference_regex.search(fname):
|
||||
lines = pkg.grep(invalid_dir_ref_regex, fname)
|
||||
@@ -637,6 +650,15 @@ to list code compiled without -fPIC.
|
||||
Another common mistake that causes this problem is linking with
|
||||
``gcc -Wl,-shared'' instead of ``gcc -shared''.''',
|
||||
|
||||
+'libtool-wrapper-in-package',
|
||||
+'''Your package contains a libtool wrapper shell script. This
|
||||
+will not work. Instead of install'ing the libtool wrapper file,
|
||||
+run
|
||||
+
|
||||
+libtool --mode=install install -m perm <file> <dest>
|
||||
+
|
||||
+to install the relinked file.''',
|
||||
+
|
||||
'binary-or-shlib-defines-rpath',
|
||||
'''The binary or shared library defines `RPATH'. Usually this is a
|
||||
bad thing because it hardcodes the path to search libraries and so
|
@ -8,10 +8,10 @@ Subject: [PATCH] no-badness-return.diff
|
||||
rpmlint | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/Filter.py
|
||||
Index: rpmlint-rpmlint-1.11/Filter.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/Filter.py
|
||||
+++ rpmlint-rpmlint-1.10/Filter.py
|
||||
--- rpmlint-rpmlint-1.11.orig/Filter.py
|
||||
+++ rpmlint-rpmlint-1.11/Filter.py
|
||||
@@ -130,7 +130,7 @@ def printAllReasons():
|
||||
if len(last_reason):
|
||||
printDescriptions(last_reason)
|
||||
@ -21,11 +21,11 @@ Index: rpmlint-rpmlint-1.10/Filter.py
|
||||
if Config.info and len(last_reason):
|
||||
printDescriptions(last_reason)
|
||||
_diagnostic = list()
|
||||
Index: rpmlint-rpmlint-1.10/rpmlint
|
||||
Index: rpmlint-rpmlint-1.11/rpmlint
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/rpmlint
|
||||
+++ rpmlint-rpmlint-1.10/rpmlint
|
||||
@@ -206,7 +206,7 @@ def main():
|
||||
--- rpmlint-rpmlint-1.11.orig/rpmlint
|
||||
+++ rpmlint-rpmlint-1.11/rpmlint
|
||||
@@ -207,7 +207,7 @@ def main():
|
||||
% (packages_checked, specfiles_checked,
|
||||
printed_messages["E"], printed_messages["W"]))
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] no-doc-for-lib.diff
|
||||
FilesCheck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -440,7 +440,7 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
--- rpmlint-rpmlint-1.11.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
@@ -464,7 +464,7 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
debuginfo_srcs = False
|
||||
debuginfo_debugs = False
|
||||
|
||||
|
@ -1,58 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:39 +0200
|
||||
Subject: [PATCH] noarch-lib64.diff
|
||||
|
||||
===================================================================
|
||||
---
|
||||
BinariesCheck.py | 15 ++++++++++++++-
|
||||
1 file changed, 14 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -345,6 +345,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
binary = False
|
||||
binary_in_usr_lib = False
|
||||
has_usr_lib_file = False
|
||||
+ file_in_lib64 = False
|
||||
|
||||
multi_pkg = False
|
||||
srpm = pkg[rpm.RPMTAG_SOURCERPM]
|
||||
@@ -363,6 +364,10 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
# only-non-binary-in-usr-lib false positives
|
||||
binary_in_usr_lib = True
|
||||
|
||||
+ if stat.S_ISREG(pkgfile.mode) and \
|
||||
+ (fname.startswith("/usr/lib64") or fname.startswith("/lib64")):
|
||||
+ file_in_lib64 = True
|
||||
+
|
||||
is_elf = 'ELF' in pkgfile.magic
|
||||
is_ar = 'current ar archive' in pkgfile.magic
|
||||
is_ocaml_native = 'Objective caml native' in pkgfile.magic
|
||||
@@ -592,9 +597,12 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
if version and version != -1 and version not in pkg.name:
|
||||
printError(pkg, 'incoherent-version-in-name', version)
|
||||
|
||||
- if not binary and not multi_pkg and pkg.arch != 'noarch':
|
||||
+ if not binary and not multi_pkg and not file_in_lib64 and pkg.arch != 'noarch':
|
||||
printError(pkg, 'no-binary')
|
||||
|
||||
+ if pkg.arch == 'noarch' and file_in_lib64:
|
||||
+ printError(pkg, 'noarch-with-lib64')
|
||||
+
|
||||
if has_usr_lib_file and not binary_in_usr_lib:
|
||||
printWarning(pkg, 'only-non-binary-in-usr-lib')
|
||||
|
||||
@@ -619,6 +627,11 @@ FHS and the FSSTND forbid this.''',
|
||||
# 'non-sparc32-binary',
|
||||
# '',
|
||||
|
||||
+'noarch-with-lib64',
|
||||
+'''This package is marked as noarch but installs files into lib64.
|
||||
+Not all architectures have this in path, so the package can't be
|
||||
+noarch.''',
|
||||
+
|
||||
'invalid-soname',
|
||||
'''The soname of the library is neither of the form lib<libname>.so.<major> or
|
||||
lib<libname>-<major>.so.''',
|
@ -1,14 +0,0 @@
|
||||
diff -u rpmlint-rpmlint-1.8.orig/Makefile rpmlint-rpmlint-1.8/Makefile
|
||||
--- rpmlint-rpmlint-1.8.orig/Makefile 2016-05-03 18:21:47.823504438 +0200
|
||||
+++ rpmlint-rpmlint-1.8/Makefile 2016-05-03 18:25:11.746636047 +0200
|
||||
@@ -39,9 +39,7 @@
|
||||
$(DESTDIR)$(LIBDIR)/[A-Z]*.py \
|
||||
$(DESTDIR)$(LIBDIR)/__*__.py ; \
|
||||
fi
|
||||
- $(PYTHON) -O -m py_compile \
|
||||
- $(DESTDIR)$(LIBDIR)/[A-Z]*.py \
|
||||
- $(DESTDIR)$(LIBDIR)/__*__.py ; \
|
||||
+ $(PYTHON) -O -m compileall -d $(LIBDIR) $(DESTDIR)$(LIBDIR)
|
||||
for file in rpmlint rpmdiff ; do \
|
||||
sed -e "s,#!/usr/bin/python ,#!$(PYTHON) ," $$file > $(DESTDIR)$(BINDIR)/$$file ; \
|
||||
chmod +x $(DESTDIR)$(BINDIR)/$$file ; \
|
@ -7,10 +7,10 @@ Subject: [PATCH] only-reg-files-are-scripts.diff
|
||||
InitScriptCheck.py | 5 ++++-
|
||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/InitScriptCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/InitScriptCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/InitScriptCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/InitScriptCheck.py
|
||||
--- rpmlint-rpmlint-1.11.orig/InitScriptCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/InitScriptCheck.py
|
||||
@@ -17,7 +17,7 @@ import AbstractCheck
|
||||
import Config
|
||||
from Filter import addDetails, printError, printWarning
|
||||
|
@ -1,8 +1,10 @@
|
||||
--- rpmlint-rpmlint-1.10.orig/PostCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/PostCheck.py
|
||||
@@ -112,20 +112,6 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
self.check_aux(
|
||||
pkg, files, prog[idx], script[idx], tag[2], prereq)
|
||||
Index: rpmlint-rpmlint-1.11/PostCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.11.orig/PostCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/PostCheck.py
|
||||
@@ -108,20 +108,6 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
pkg, files, prog[idx],
|
||||
pkg.header[tag[0]][idx], tag[2], prereq)
|
||||
|
||||
- ghost_files = pkg.ghostFiles()
|
||||
- if ghost_files:
|
||||
@ -20,8 +22,8 @@
|
||||
-
|
||||
def check_aux(self, pkg, files, prog, script, tag, prereq):
|
||||
if script:
|
||||
if prog:
|
||||
@@ -195,10 +181,6 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
script_str = Pkg.b2s(script)
|
||||
@@ -193,10 +179,6 @@ class PostCheck(AbstractCheck.AbstractCh
|
||||
check = PostCheck()
|
||||
|
||||
# Add information about checks
|
||||
@ -29,6 +31,6 @@
|
||||
-'postin-without-ghost-file-creation',
|
||||
-'''A file tagged as ghost is not created during %prein nor during %postin.''',
|
||||
-)
|
||||
for scriptlet in map(lambda x: '%' + x, RPM_SCRIPTLETS):
|
||||
for scriptlet in map(lambda x: '%' + x, Pkg.RPM_SCRIPTLETS):
|
||||
addDetails(
|
||||
'one-line-command-in-%s' % scriptlet,
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] rpmgroup-checks.diff
|
||||
TagsCheck.py | 6 ++++++
|
||||
1 file changed, 6 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -743,6 +743,8 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -750,6 +750,8 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
self._unexpanded_macros(pkg, 'Group', group)
|
||||
if not group:
|
||||
printError(pkg, 'no-group-tag')
|
||||
@ -20,7 +20,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
elif VALID_GROUPS and group not in VALID_GROUPS:
|
||||
printWarning(pkg, 'non-standard-group', group)
|
||||
|
||||
@@ -1067,6 +1069,10 @@ won't fool the specfile parser, and rebu
|
||||
@@ -1085,6 +1087,10 @@ won't fool the specfile parser, and rebu
|
||||
'''There is no Group tag in your package. You have to specify a valid group
|
||||
in your spec file using the Group tag.''',
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:e69290bebcce9581ba417c3db81cc5f51731927f0b7ea172b94446df8fab49cd
|
||||
size 20763016
|
3
rpmlint-1.11.tar.gz
Normal file
3
rpmlint-1.11.tar.gz
Normal file
@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:2ea1f4726382bcf24652ea710b4e98fdfd7f83a7c44a7ee2f5eaf5b201be9ac3
|
||||
size 21774264
|
@ -1,18 +1,20 @@
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -184,7 +184,7 @@ compr_regex = re.compile(r'\.(gz|z|Z|zip
|
||||
Index: rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.11.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/FilesCheck.py
|
||||
@@ -185,7 +185,7 @@ compr_regex = re.compile(compressions +
|
||||
absolute_regex = re.compile(r'^/([^/]+)')
|
||||
absolute2_regex = re.compile(r'^/?([^/]+)')
|
||||
points_regex = re.compile(r'^\.\./(.*)')
|
||||
-doc_regex = re.compile(r'^/usr(/share|/X11R6)?/(doc|man|info)/')
|
||||
-doc_regex = re.compile(r'^/usr(/share|/X11R6)?/(doc|man|info)/|^/usr/share/gnome/help')
|
||||
+doc_regex = re.compile(r'^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help')
|
||||
bin_regex = re.compile(r'^/(?:usr/(?:s?bin|games)|s?bin)/(.*)')
|
||||
includefile_regex = re.compile(r'\.(c|h)(pp|xx)?$', re.IGNORECASE)
|
||||
develfile_regex = re.compile(r'\.(a|cmxa?|mli?|gir)$')
|
||||
Index: rpmlint-rpmlint-1.10/I18NCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/I18NCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/I18NCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/I18NCheck.py
|
||||
--- rpmlint-rpmlint-1.11.orig/I18NCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/I18NCheck.py
|
||||
@@ -30,7 +30,7 @@ INCORRECT_LOCALES = {
|
||||
'en_UK': 'en_GB'}
|
||||
|
||||
|
100
rpmlint.changes
100
rpmlint.changes
@ -1,3 +1,103 @@
|
||||
-------------------------------------------------------------------
|
||||
Sat Jan 12 19:44:23 UTC 2019 - Dirk Mueller <dmueller@suse.com>
|
||||
|
||||
- update to 1.11:
|
||||
* Avoid exception on inaccessible scripts
|
||||
* Print out the error content on UnicodeError to make flake8 happy
|
||||
* Fix flake8 warning about missing space around operators
|
||||
* Use compressions when checking for backup files
|
||||
* Account for arch specific code in /usr/share
|
||||
* Check for installed libtool wrapper files
|
||||
* Check for missing optional dependencies
|
||||
* Consider gnome help for doc files
|
||||
* Check for noarch package with files in lib64
|
||||
* Verify if description is longer than summary
|
||||
* Explicitly tell users how to set URL
|
||||
* Ignore pytest_cache directory
|
||||
* confusing-invalid-spec-name
|
||||
* Ignore orig/rej leftovers after patching
|
||||
* Reenable Travis testing against Fedora Rawhide
|
||||
* Check all sections that should not use %buildroot in them
|
||||
* Put in default buildroot value used by Fedora/openSUSE
|
||||
* Stricter interpreter check
|
||||
* Use compileall to avoid %buildroot to be in pyc
|
||||
* Drop deprecated config file usage, 0.88 is pretty old anyway
|
||||
* Adjust Version to not print outdated Copyright
|
||||
* Rework Travis checks against latest Centos and Fedora releases
|
||||
* Fix exception handling
|
||||
* Fix various flake8-import-order test regressions
|
||||
* Blacklist newer pycodestyle warnings
|
||||
* Fix compatibility with file 5.33+
|
||||
* Python 3.7.0b5 magic number is 3394
|
||||
* Update TagsCheck.py
|
||||
* pyc related tests: DRY
|
||||
* Fix getting pyc mtime on Python 3.7
|
||||
* Always import XDG desktop files as utf8
|
||||
* Fix Flake8 warnings
|
||||
* Update Magic values for Python 3.7 (Fixes #123)
|
||||
* Improve XDG Menu checks stability
|
||||
* Test added.
|
||||
* Ignore useless-provides on debuginfo provides (#112)
|
||||
* Properly handle the exception on missing files
|
||||
* Avoid calling close on undefined fd variable
|
||||
* Code formatting fixed to meet the style.
|
||||
* Modify FakePkg to let the test.sh pass.
|
||||
* _sourcedir macro defined.
|
||||
* Avoid summary-not-capitalized warning on digits
|
||||
* Avoid catch-all except statements
|
||||
* Use ImportError to avoid catch-all except: statements
|
||||
* Handle E741: ambiguous identifier
|
||||
* Accept python(abi) as a valid versioned python dependency
|
||||
* Binariescheck: Check for chroot/chdir on ARM, PPC
|
||||
* Avoid false positives on is_elf check
|
||||
* Handle %post scripts that contain non-ascii characters
|
||||
* Further tweak lib_regex
|
||||
* split wrong-script-interpreter into env-script-interpreter
|
||||
* Validate Appdata also when appstream-util is unavailable
|
||||
* Remove dependency on unicodedata
|
||||
* Lower false-positives on summary-not-capitalized
|
||||
* Tighten wrong-script-interpreter check to lower false positives
|
||||
* Check for unexpanded macros in more Tags
|
||||
* Rename local file variable to fname
|
||||
* Skip binaryinfo-readelf-failed on non-ELF archives
|
||||
* Add check for validating file extensions
|
||||
* Do not report error if call positions are unknown
|
||||
* Execute chroot tests also on x86 rpms
|
||||
* Tighten lib_regex to avoid false positive in python bindings
|
||||
* Better details for wrong-script-interpreter
|
||||
* Extend scm_regex to capture more SCM system files
|
||||
* AppDataCheck: Pass --nonet to appstream-util if NetworkEnabled is False
|
||||
* test: Fix cpio location in centos6
|
||||
* test: Combine run commands in fedoradev container
|
||||
* test: Remove dnf upgrade from fedora containers
|
||||
* test: Dockerfile whitespace tweaks
|
||||
|
||||
- drop patches that were upstreamed:
|
||||
0001-Accept-python-abi-as-a-valid-versioned-python-depend.patch,
|
||||
0001-Always-import-XDG-desktop-files-as-utf8.patch,
|
||||
0001-Avoid-calling-close-on-undefined-fd-variable.patch,
|
||||
0001-Avoid-false-positives-on-is_elf-check.patch,
|
||||
0001-Backport-d8f423b575e8be387d33bc3af176baf978efacbb.patch,
|
||||
0001-Binariescheck-Check-for-chroot-chdir-on-ARM-PPC.patch,
|
||||
0001-Execute-chroot-tests-also-on-x86-rpms.patch,
|
||||
0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch,
|
||||
0001-Fix-compatibility-with-file-5.33.patch,
|
||||
0001-Handle-post-scripts-that-contain-non-ascii-character.patch,
|
||||
0001-Improve-XDG-Menu-checks-stability.patch,
|
||||
0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch,
|
||||
0001-split-wrong-script-interpreter-into-env-script-inter.patch,
|
||||
0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch,
|
||||
0007-Validate-Appdata-also-when-appstream-util-is-unavail.patch,
|
||||
better-wrong-script.diff, buildroot-doc.diff,
|
||||
buildroot-in-scripts.diff, compressed-backup-regex.diff,
|
||||
confusing-invalid-spec-name.diff, description-check.diff,
|
||||
drop-unicodedata-dep.diff, ignore-readelf-ar-error.diff,
|
||||
libtool-wrapper-check.diff, noarch-lib64.diff,
|
||||
omit_BUILDROOT_from_pyo_files.patch,
|
||||
selfconflicts-provide.diff, stricter-interpreter-check.diff,
|
||||
suse-whitelist-opensuse.diff, update-magic-values-python-37.patch,
|
||||
usr-arch.diff
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed Jan 09 19:18:49 UTC 2019 - opensuse-packaging@opensuse.org
|
||||
|
||||
|
33
rpmlint.spec
33
rpmlint.spec
@ -17,7 +17,7 @@
|
||||
|
||||
|
||||
Name: rpmlint
|
||||
Version: 1.10
|
||||
Version: 1.11
|
||||
Release: 0
|
||||
Summary: RPM file correctness checker
|
||||
License: GPL-2.0-or-later
|
||||
@ -42,54 +42,23 @@ Patch08: no-doc-for-lib.diff
|
||||
Patch09: suse-filter-exception.diff
|
||||
Patch10: suse-spdx-license-exceptions.patch
|
||||
Patch11: suse-skip-macro-expansion.diff
|
||||
Patch20: usr-arch.diff
|
||||
Patch23: suse-filter-more-verbose.diff
|
||||
Patch24: docdata-examples.diff
|
||||
Patch25: yast-provides.diff
|
||||
Patch27: better-wrong-script.diff
|
||||
Patch28: buildroot-doc.diff
|
||||
Patch29: rpmgroup-checks.diff
|
||||
Patch30: devel-provide-is-devel-package.diff
|
||||
Patch31: only-reg-files-are-scripts.diff
|
||||
Patch32: buildroot-in-scripts.diff
|
||||
Patch33: libtool-wrapper-check.diff
|
||||
Patch35: noarch-lib64.diff
|
||||
Patch37: description-check.diff
|
||||
Patch38: 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch
|
||||
Patch39: selfconflicts-provide.diff
|
||||
Patch40: no-badness-return.diff
|
||||
Patch41: suse-shlib-devel-dependency.diff
|
||||
Patch42: 0001-Improve-XDG-Menu-checks-stability.patch
|
||||
Patch43: stricter-interpreter-check.diff
|
||||
Patch44: confusing-invalid-spec-name.diff
|
||||
Patch48: suse-whitelist-opensuse.diff
|
||||
Patch49: extend-suse-conffiles-check.diff
|
||||
Patch50: compressed-backup-regex.diff
|
||||
Patch51: suse-speccheck-utf8.diff
|
||||
Patch52: 0001-Accept-python-abi-as-a-valid-versioned-python-depend.patch
|
||||
Patch54: suse-ignore-specfile-errors.diff
|
||||
Patch55: invalid-filerequires.diff
|
||||
Patch57: check-for-self-provides.diff
|
||||
Patch58: remove-ghostfile-checks.diff
|
||||
Patch59: 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch
|
||||
Patch60: 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch
|
||||
Patch61: 0001-Execute-chroot-tests-also-on-x86-rpms.patch
|
||||
Patch62: ignore-readelf-ar-error.diff
|
||||
Patch63: fix-diag-sortorder.diff
|
||||
Patch64: drop-unicodedata-dep.diff
|
||||
Patch65: 0001-split-wrong-script-interpreter-into-env-script-inter.patch
|
||||
Patch66: 0001-Handle-post-scripts-that-contain-non-ascii-character.patch
|
||||
Patch67: omit_BUILDROOT_from_pyo_files.patch
|
||||
Patch68: 0001-Avoid-false-positives-on-is_elf-check.patch
|
||||
Patch69: 0007-Validate-Appdata-also-when-appstream-util-is-unavail.patch
|
||||
Patch71: 0001-Avoid-calling-close-on-undefined-fd-variable.patch
|
||||
Patch72: rpmlint-slpp-NUM-NUM.patch
|
||||
Patch73: 0001-Binariescheck-Check-for-chroot-chdir-on-ARM-PPC.patch
|
||||
Patch74: 0001-Always-import-XDG-desktop-files-as-utf8.patch
|
||||
Patch75: 0001-Fix-compatibility-with-file-5.33.patch
|
||||
Patch76: update-magic-values-python-37.patch
|
||||
Patch77: suse-rpmlint-all-pie.patch
|
||||
Patch78: 0001-Backport-d8f423b575e8be387d33bc3af176baf978efacbb.patch
|
||||
BuildRequires: obs-service-format_spec_file
|
||||
BuildRequires: python3-flake8
|
||||
BuildRequires: python3-pytest
|
||||
|
@ -1,41 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:39 +0200
|
||||
Subject: [PATCH] selfconflicts-provide.diff
|
||||
|
||||
===================================================================
|
||||
---
|
||||
TagsCheck.py | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -865,6 +865,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()]
|
||||
+ conf_names = map(lambda x: x[0].split(':/')[0], pkg.conflicts())
|
||||
|
||||
for o in (x for x in obs_names if x not in prov_names):
|
||||
printWarning(pkg, 'obsolete-not-provided', o)
|
||||
@@ -876,6 +877,8 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
# https://bugzilla.redhat.com/460872
|
||||
useless_provides = []
|
||||
for p in prov_names:
|
||||
+ if p in conf_names:
|
||||
+ printWarning(pkg, 'conflicts-with-provides', p)
|
||||
if prov_names.count(p) != 1 and p not in useless_provides:
|
||||
useless_provides.append(p)
|
||||
for p in useless_provides:
|
||||
@@ -1011,6 +1014,10 @@ the Release tag.''',
|
||||
'''There is no Name tag in your package. You have to specify a name using the
|
||||
Name tag.''',
|
||||
|
||||
+'conflicts-with-provides',
|
||||
+'''The same symbolic name is provided and conflicted. This package might be
|
||||
+uninstallable, if versioning matches''',
|
||||
+
|
||||
'non-coherent-filename',
|
||||
'''The file which contains the package should be named
|
||||
<NAME>-<VERSION>-<RELEASE>.<ARCH>.rpm.''',
|
@ -1,23 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:39 +0200
|
||||
Subject: [PATCH] stricter-interpreter-check.diff
|
||||
|
||||
===================================================================
|
||||
---
|
||||
FilesCheck.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/FilesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/FilesCheck.py
|
||||
@@ -872,7 +872,8 @@ class FilesCheck(AbstractCheck.AbstractC
|
||||
f.endswith('.la')):
|
||||
printError(pkg, 'script-without-shebang', f)
|
||||
|
||||
- if not mode_is_exec and not is_doc:
|
||||
+ if not mode_is_exec and not is_doc and \
|
||||
+ interpreter and interpreter.startswith("/"):
|
||||
printError(pkg, 'non-executable-script', f,
|
||||
"%o" % perm, interpreter,
|
||||
interpreter_args)
|
@ -7,10 +7,10 @@ Subject: [PATCH] suse-binarieschecks.diff
|
||||
BinariesCheck.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 56 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
--- rpmlint-rpmlint-1.11.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/BinariesCheck.py
|
||||
@@ -16,7 +16,7 @@ import rpm
|
||||
|
||||
import AbstractCheck
|
||||
@ -20,17 +20,17 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
import Pkg
|
||||
|
||||
|
||||
@@ -56,6 +56,9 @@ class BinaryInfo(object):
|
||||
@@ -54,6 +54,9 @@ class BinaryInfo(object):
|
||||
setuid_call_regex = create_regexp_call(r'set(?:res|e)?uid')
|
||||
setgroups_call_regex = create_regexp_call(r'(?:ini|se)tgroups')
|
||||
chroot_call_regex = create_regexp_call('chroot')
|
||||
# 401eb8: e8 c3 f0 ff ff callq 400f80 <chdir@plt>
|
||||
objdump_call_regex = re.compile(br'callq?\s(.*)')
|
||||
+ debuginfo_regex = re.compile(r'^\s+\[\s*\d+\]\s+\.debug_.*\s+')
|
||||
+ symtab_regex = re.compile(r'^\s+\[\s*\d+\]\s+\.symtab\s+')
|
||||
+ gethostbyname_call_regex = create_regexp_call(r'(gethostbyname|gethostbyname2|gethostbyaddr|gethostbyname_r|gethostbyname2_r|gethostbyaddr_r)')
|
||||
|
||||
forbidden_functions = Config.getOption("WarnOnFunction")
|
||||
if forbidden_functions:
|
||||
@@ -84,7 +87,10 @@ class BinaryInfo(object):
|
||||
@@ -83,7 +86,10 @@ class BinaryInfo(object):
|
||||
self.exec_stack = False
|
||||
self.exit_calls = []
|
||||
self.forbidden_calls = []
|
||||
@ -39,9 +39,9 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
+ self.debuginfo = False
|
||||
+ self.symtab = False
|
||||
self.tail = ''
|
||||
self.lto_sections = False
|
||||
|
||||
self.setgid = False
|
||||
@@ -121,6 +127,14 @@ class BinaryInfo(object):
|
||||
@@ -134,6 +140,14 @@ class BinaryInfo(object):
|
||||
self.non_pic = False
|
||||
continue
|
||||
|
||||
@ -53,11 +53,11 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
+ self.symtab = True
|
||||
+ continue
|
||||
+
|
||||
r = BinaryInfo.soname_regex.search(l)
|
||||
r = BinaryInfo.soname_regex.search(line)
|
||||
if r:
|
||||
self.soname = r.group(1)
|
||||
@@ -161,6 +175,9 @@ class BinaryInfo(object):
|
||||
if BinaryInfo.chroot_call_regex.search(l):
|
||||
@@ -174,6 +188,9 @@ class BinaryInfo(object):
|
||||
if BinaryInfo.chroot_call_regex.search(line):
|
||||
self.chroot = True
|
||||
|
||||
+ if BinaryInfo.gethostbyname_call_regex.search(l):
|
||||
@ -65,8 +65,8 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
+
|
||||
if BinaryInfo.forbidden_functions:
|
||||
for r_name, func in BinaryInfo.forbidden_functions.items():
|
||||
ret = func['f_regex'].search(l)
|
||||
@@ -392,13 +409,26 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
ret = func['f_regex'].search(line)
|
||||
@@ -432,13 +449,26 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
continue
|
||||
|
||||
# stripped ?
|
||||
@ -94,7 +94,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
if is_shlib:
|
||||
has_lib = True
|
||||
|
||||
@@ -453,6 +483,10 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
@@ -496,6 +526,10 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
printWarning(pkg, ec, fname,
|
||||
BinaryInfo.forbidden_functions[ec]['f_name'])
|
||||
|
||||
@ -105,7 +105,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
# rpath ?
|
||||
if bin_info.rpath:
|
||||
for p in bin_info.rpath:
|
||||
@@ -666,6 +700,14 @@ with the intended shared libraries only.
|
||||
@@ -724,6 +758,14 @@ with the intended shared libraries only.
|
||||
'ldd-failed',
|
||||
'''Executing ldd on this file failed, all checks could not be run.''',
|
||||
|
||||
@ -120,7 +120,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
'executable-stack',
|
||||
'''The binary declares the stack as executable. Executable stack is usually an
|
||||
error as it is only needed if the code contains GCC trampolines or similar
|
||||
@@ -678,6 +720,10 @@ don\'t define a proper .note.GNU-stack s
|
||||
@@ -736,6 +778,10 @@ don\'t define a proper .note.GNU-stack s
|
||||
make the stack executable. Usual suspects include use of a non-GNU linker or
|
||||
an old GNU linker version.''',
|
||||
|
||||
@ -131,7 +131,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
'shared-lib-calls-exit',
|
||||
'''This library package calls exit() or _exit(), probably in a non-fork()
|
||||
context. Doing so from a library is strongly discouraged - when a library
|
||||
@@ -696,6 +742,12 @@ that use prelink, make sure that prelink
|
||||
@@ -754,6 +800,12 @@ that use prelink, make sure that prelink
|
||||
placing a blacklist file in /etc/prelink.conf.d. For more information, see
|
||||
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=256900#49''',
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] suse-filter-exception.diff
|
||||
Config.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 54 insertions(+), 7 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/Config.py
|
||||
Index: rpmlint-rpmlint-1.11/Config.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/Config.py
|
||||
+++ rpmlint-rpmlint-1.10/Config.py
|
||||
@@ -114,12 +114,23 @@ def getOption(name, default=""):
|
||||
--- rpmlint-rpmlint-1.11.orig/Config.py
|
||||
+++ rpmlint-rpmlint-1.11/Config.py
|
||||
@@ -111,12 +111,23 @@ def getOption(name, default=""):
|
||||
_filters = []
|
||||
_filters_re = None
|
||||
|
||||
@ -37,7 +37,7 @@ Index: rpmlint-rpmlint-1.10/Config.py
|
||||
|
||||
|
||||
def removeFilter(s):
|
||||
@@ -137,8 +148,13 @@ _scoring = {}
|
||||
@@ -134,8 +145,13 @@ _scoring = {}
|
||||
|
||||
|
||||
def setBadness(s, score):
|
||||
@ -51,7 +51,7 @@ Index: rpmlint-rpmlint-1.10/Config.py
|
||||
|
||||
def badness(s):
|
||||
return _scoring.get(s, 0)
|
||||
@@ -149,11 +165,24 @@ _non_named_group_re = re.compile(r'[^\\]
|
||||
@@ -146,11 +162,24 @@ _non_named_group_re = re.compile(r'[^\\]
|
||||
|
||||
def isFiltered(s):
|
||||
global _filters_re
|
||||
@ -80,7 +80,7 @@ Index: rpmlint-rpmlint-1.10/Config.py
|
||||
_filters_re = '(?:' + _filters[0] + ')'
|
||||
|
||||
for idx in range(1, len(_filters)):
|
||||
@@ -165,9 +194,27 @@ def isFiltered(s):
|
||||
@@ -162,9 +191,27 @@ def isFiltered(s):
|
||||
_filters_re = _filters_re + '|(?:' + _filters[idx] + ')'
|
||||
_filters_re = re.compile(_filters_re)
|
||||
|
||||
|
@ -7,10 +7,10 @@ Subject: [PATCH] suse-filter-more-verbose.diff
|
||||
Config.py | 25 +++++++++++++++++++++++--
|
||||
1 file changed, 23 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/Config.py
|
||||
Index: rpmlint-rpmlint-1.11/Config.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/Config.py
|
||||
+++ rpmlint-rpmlint-1.10/Config.py
|
||||
--- rpmlint-rpmlint-1.11.orig/Config.py
|
||||
+++ rpmlint-rpmlint-1.11/Config.py
|
||||
@@ -10,6 +10,7 @@
|
||||
import locale
|
||||
import os.path
|
||||
@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/Config.py
|
||||
|
||||
try:
|
||||
from __version__ import __version__
|
||||
@@ -180,7 +181,17 @@ def isFiltered(s):
|
||||
@@ -177,7 +178,17 @@ def isFiltered(s):
|
||||
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] +')'
|
||||
@ -38,7 +38,7 @@ Index: rpmlint-rpmlint-1.10/Config.py
|
||||
|
||||
if _filters_re == None and len(_filters):
|
||||
_filters_re = '(?:' + _filters[0] + ')'
|
||||
@@ -192,7 +203,17 @@ def isFiltered(s):
|
||||
@@ -189,7 +200,17 @@ def isFiltered(s):
|
||||
if '(' in _filters[idx]:
|
||||
_non_named_group_re.subn('(:?', _filters[idx])
|
||||
_filters_re = _filters_re + '|(?:' + _filters[idx] + ')'
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] suse-ignore-specfile-errors.diff
|
||||
SpecCheck.py | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/SpecCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -559,9 +559,8 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||
--- rpmlint-rpmlint-1.11.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/SpecCheck.py
|
||||
@@ -551,9 +551,8 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||
printWarning(pkg, "patch-not-applied",
|
||||
"Patch%d:" % pnum, pfile)
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -416,6 +416,7 @@ lib_devel_number_regex = re.compile(r'^l
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -420,6 +420,7 @@ lib_devel_number_regex = re.compile(r'^l
|
||||
invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE)
|
||||
lib_package_regex = re.compile(r'(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE)
|
||||
leading_space_regex = re.compile(r'^\s+')
|
||||
@ -8,7 +10,7 @@
|
||||
license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s')
|
||||
invalid_version_regex = re.compile(r'([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
|
||||
# () are here for grouping purpose in the regexp
|
||||
@@ -635,10 +636,12 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
@@ -639,10 +640,12 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
base = is_devel.group(1)
|
||||
dep = None
|
||||
has_so = False
|
||||
@ -22,7 +24,7 @@
|
||||
if has_so:
|
||||
base_or_libs = base + '/' + base + '-libs/lib' + base
|
||||
# try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)")
|
||||
@@ -675,6 +678,15 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
@@ -679,6 +682,15 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
if prov not in (x[0] for x in pkg.provides()):
|
||||
printWarning(pkg, 'no-provides', prov)
|
||||
|
||||
@ -38,7 +40,7 @@
|
||||
# List of words to ignore in spell check
|
||||
ignored_words = set()
|
||||
for pf in pkg.files():
|
||||
@@ -1108,6 +1120,11 @@ once.''',
|
||||
@@ -1126,6 +1138,11 @@ once.''',
|
||||
'no-url-tag',
|
||||
'''The URL tag is missing. Please add a http or ftp link to the project location.''',
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -549,10 +549,14 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
--- rpmlint-rpmlint-1.11.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/BinariesCheck.py
|
||||
@@ -558,10 +558,14 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
if ocaml_mixed_regex.search(bin_info.tail):
|
||||
printWarning(pkg, 'ocaml-mixed-executable', fname)
|
||||
|
||||
@ -21,7 +21,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
|
||||
if bin_info.readelf_error:
|
||||
continue
|
||||
@@ -804,6 +808,10 @@ stripping process.''',
|
||||
@@ -810,6 +814,10 @@ stripping process.''',
|
||||
'''This executable must be position independent. Check that it is built with
|
||||
-fPIE/-fpie in compiler flags and -pie in linker flags.''',
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] suse-shlib-devel-dependency.diff
|
||||
TagsCheck.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -663,10 +663,10 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -667,10 +667,10 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
if pkg_config_regex.match(fname) and fname.endswith('.pc'):
|
||||
has_pc = True
|
||||
if has_so:
|
||||
|
@ -1,8 +1,8 @@
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -462,16 +462,6 @@ so_dep_regex = re.compile(r'\.so(\.[0-9a
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -466,16 +466,6 @@ so_dep_regex = re.compile(r'\.so(\.[0-9a
|
||||
# we assume that no rpm packages existed before rpm itself existed...
|
||||
oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d"))
|
||||
|
||||
@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
_enchant_checkers = {}
|
||||
|
||||
|
||||
@@ -921,14 +911,6 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
@@ -934,14 +924,6 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
res = Pkg.b2s(pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())])
|
||||
self._unexpanded_macros(pkg, tag, res)
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] Handle SPDX style license exceptions
|
||||
TagsCheck.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 50 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -139,6 +139,34 @@ DEFAULT_VALID_LICENSES = (
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -140,6 +140,34 @@ DEFAULT_VALID_LICENSES = (
|
||||
'Shareware',
|
||||
)
|
||||
|
||||
@ -46,7 +46,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
BAD_WORDS = {
|
||||
'alot': 'a lot',
|
||||
'accesnt': 'accent',
|
||||
@@ -404,6 +432,7 @@ VALID_GROUPS = Config.getOption('ValidGr
|
||||
@@ -408,6 +436,7 @@ VALID_GROUPS = Config.getOption('ValidGr
|
||||
if VALID_GROUPS is None: # get defaults from rpm package only if it's not set
|
||||
VALID_GROUPS = Pkg.get_default_valid_rpmgroups()
|
||||
VALID_LICENSES = Config.getOption('ValidLicenses', DEFAULT_VALID_LICENSES)
|
||||
@ -54,7 +54,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
INVALID_REQUIRES = map(re.compile, Config.getOption('InvalidRequires', DEFAULT_INVALID_REQUIRES))
|
||||
packager_regex = re.compile(Config.getOption('Packager'))
|
||||
changelog_version_regex = re.compile(r'[^>]([^ >]+)\s*$')
|
||||
@@ -418,6 +447,7 @@ lib_package_regex = re.compile(r'(?:^(?:
|
||||
@@ -422,6 +451,7 @@ lib_package_regex = re.compile(r'(?:^(?:
|
||||
leading_space_regex = re.compile(r'^\s+')
|
||||
pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/')
|
||||
license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s')
|
||||
@ -62,7 +62,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
invalid_version_regex = re.compile(r'([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE)
|
||||
# () are here for grouping purpose in the regexp
|
||||
forbidden_words_regex = re.compile(r'(%s)' % Config.getOption('ForbiddenWords'), re.IGNORECASE)
|
||||
@@ -788,6 +818,10 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
@@ -795,6 +825,10 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
# printWarning(pkg, 'package-provides-itself')
|
||||
# break
|
||||
|
||||
@ -73,7 +73,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
def split_license(license):
|
||||
return (x.strip() for x in
|
||||
(l for l in license_regex.split(license) if l))
|
||||
@@ -798,7 +832,17 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
@@ -805,7 +839,17 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
else:
|
||||
valid_license = True
|
||||
if rpm_license not in VALID_LICENSES:
|
||||
@ -92,7 +92,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
if l1 in VALID_LICENSES:
|
||||
continue
|
||||
for l2 in split_license(l1):
|
||||
@@ -1074,6 +1118,11 @@ your specfile.''',
|
||||
@@ -1092,6 +1136,11 @@ your specfile.''',
|
||||
'''The value of the License tag was not recognized. Known values are:
|
||||
"%s".''' % '", "'.join(VALID_LICENSES),
|
||||
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] suse-speccheck-utf8.diff
|
||||
SpecCheck.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/SpecCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -648,8 +648,8 @@ SPEC file to build a valid RPM package.'
|
||||
--- rpmlint-rpmlint-1.11.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/SpecCheck.py
|
||||
@@ -642,8 +642,8 @@ SPEC file to build a valid RPM package.'
|
||||
("Name:" tag). Either rename your package or the specfile.''',
|
||||
|
||||
'non-utf8-spec-file',
|
||||
|
@ -1,7 +1,7 @@
|
||||
Index: rpmlint-rpmlint-1.10/test.sh
|
||||
Index: rpmlint-rpmlint-1.11/test.sh
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/test.sh
|
||||
+++ rpmlint-rpmlint-1.10/test.sh
|
||||
--- rpmlint-rpmlint-1.11.orig/test.sh
|
||||
+++ rpmlint-rpmlint-1.11/test.sh
|
||||
@@ -19,7 +19,10 @@ for i in $TESTPATH/test.*.py; do
|
||||
fi
|
||||
done
|
||||
@ -14,7 +14,7 @@ Index: rpmlint-rpmlint-1.10/test.sh
|
||||
|
||||
echo "Check that rpmlint executes with no unexpected errors"
|
||||
echo "...in default locale"
|
||||
@@ -40,10 +46,6 @@ $PYTEST -v || exit $?
|
||||
@@ -40,10 +43,6 @@ $PYTEST -v || exit $?
|
||||
|
||||
unset PYTHONWARNINGS
|
||||
|
||||
@ -25,11 +25,11 @@ Index: rpmlint-rpmlint-1.10/test.sh
|
||||
echo "man page tests"
|
||||
if man --help 2>&1 | grep -q -- --warnings; then
|
||||
tmpfile=$(mktemp) || exit 1
|
||||
Index: rpmlint-rpmlint-1.10/rpmlint
|
||||
Index: rpmlint-rpmlint-1.11/rpmlint
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/rpmlint
|
||||
+++ rpmlint-rpmlint-1.10/rpmlint
|
||||
@@ -269,8 +269,10 @@ if not os.path.exists(os.path.expanduser
|
||||
--- rpmlint-rpmlint-1.11.orig/rpmlint
|
||||
+++ rpmlint-rpmlint-1.11/rpmlint
|
||||
@@ -267,8 +267,10 @@ conf_file = _default_user_conf
|
||||
info_error = set()
|
||||
|
||||
# load global config files
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] suse-url-check.diff
|
||||
TagsCheck.py | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.9/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.9.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.9/TagsCheck.py
|
||||
@@ -796,7 +796,7 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -803,7 +803,7 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
if not valid_license:
|
||||
self._unexpanded_macros(pkg, 'License', rpm_license)
|
||||
|
||||
@ -20,12 +20,3 @@ Index: rpmlint-rpmlint-1.9/TagsCheck.py
|
||||
if hasattr(rpm, 'RPMTAG_%s' % tag.upper()):
|
||||
url = Pkg.b2s(pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())])
|
||||
self._unexpanded_macros(pkg, tag, url, is_url=True)
|
||||
@@ -1106,7 +1106,7 @@ once.''',
|
||||
'''This rpm requires a specific release of another package.''',
|
||||
|
||||
'no-url-tag',
|
||||
-'''The URL tag is missing.''',
|
||||
+'''The URL tag is missing. Please add a http or ftp link to the project location.''',
|
||||
|
||||
'name-repeated-in-summary',
|
||||
'''The name of the package is repeated in its summary. This is often redundant
|
||||
|
@ -7,11 +7,11 @@ Subject: [PATCH] suse-version.diff
|
||||
SpecCheck.py | 16 ++++++++++++++++
|
||||
1 file changed, 16 insertions(+)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/SpecCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
@@ -51,6 +51,7 @@ packager_regex = re_tag_compile('Package
|
||||
--- rpmlint-rpmlint-1.11.orig/SpecCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/SpecCheck.py
|
||||
@@ -49,6 +49,7 @@ packager_regex = re_tag_compile('Package
|
||||
buildarch_regex = re_tag_compile('BuildArch(?:itectures)?')
|
||||
buildprereq_regex = re_tag_compile('BuildPreReq')
|
||||
prereq_regex = re_tag_compile(r'PreReq(\(.*\))')
|
||||
@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/SpecCheck.py
|
||||
|
||||
make_check_regex = re.compile(r'(^|\s|%{?__)make}?\s+(check|test)')
|
||||
rm_regex = re.compile(r'(^|\s)((.*/)?rm|%{?__rm}?) ')
|
||||
@@ -391,6 +392,12 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||
@@ -389,6 +390,12 @@ class SpecCheck(AbstractCheck.AbstractCh
|
||||
if not res.group(1).startswith('%'):
|
||||
printWarning(pkg, 'hardcoded-prefix-tag', res.group(1))
|
||||
|
||||
|
@ -1,38 +0,0 @@
|
||||
From ceebc0de2c3a9bb1663418d75a4b0de1d15740b2 Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Sun, 1 Oct 2017 14:06:31 +0200
|
||||
Subject: [PATCH] Lower false-positives on summary-not-capitalized
|
||||
|
||||
Allow some 'names' at the beginning of the summary to be
|
||||
non-capitalized.
|
||||
---
|
||||
TagsCheck.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/TagsCheck.py b/TagsCheck.py
|
||||
index ea131e3..d3da24c 100644
|
||||
--- a/TagsCheck.py
|
||||
+++ b/TagsCheck.py
|
||||
@@ -397,6 +397,9 @@ BAD_WORDS = {
|
||||
'xwindows': 'X'
|
||||
}
|
||||
|
||||
+CAPITALIZED_IGNORE_LIST = (
|
||||
+ 'jQuery', 'openSUSE', 'wxWidgets', 'a', 'an', 'uWSGI')
|
||||
+
|
||||
DEFAULT_INVALID_REQUIRES = ('^is$', '^not$', '^owned$', '^by$', '^any$',
|
||||
'^package$', r'^libsafe\.so\.')
|
||||
|
||||
@@ -911,7 +914,8 @@ class TagsCheck(AbstractCheck.AbstractCheck):
|
||||
spell_check(pkg, summary, 'Summary(%s)', lang, ignored_words)
|
||||
if '\n' in summary:
|
||||
printError(pkg, 'summary-on-multiple-lines', lang)
|
||||
- if summary[0] != summary[0].upper():
|
||||
+ if (summary[0] != summary[0].upper() and
|
||||
+ summary.partition(' ')[0] not in CAPITALIZED_IGNORE_LIST):
|
||||
printWarning(pkg, 'summary-not-capitalized', lang, summary)
|
||||
if summary[-1] == '.':
|
||||
printWarning(pkg, 'summary-ended-with-dot', lang, summary)
|
||||
--
|
||||
2.14.1
|
||||
|
@ -1,22 +0,0 @@
|
||||
From 52b715763217bbc1cfcad9bba8e6a446e820690e Mon Sep 17 00:00:00 2001
|
||||
From: Dirk Mueller <dirk@dmllr.de>
|
||||
Date: Tue, 13 Feb 2018 13:42:27 +0100
|
||||
Subject: [PATCH] Update Magic values for Python 3.7 (Fixes #123)
|
||||
|
||||
---
|
||||
FilesCheck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/FilesCheck.py b/FilesCheck.py
|
||||
index 2ece474..232a918 100644
|
||||
--- a/FilesCheck.py
|
||||
+++ b/FilesCheck.py
|
||||
@@ -331,7 +331,7 @@ def peek(filename, pkg, length=1024):
|
||||
'3.4': [3310],
|
||||
'3.5': [3350, 3351], # 3350 for < 3.5.2
|
||||
'3.6': [3379],
|
||||
- '3.7': [3390],
|
||||
+ '3.7': [3390, 3391, 3392, 3393],
|
||||
}
|
||||
|
||||
|
@ -1,30 +0,0 @@
|
||||
From: Some One <nobody@opensuse.org>
|
||||
Date: Thu, 9 Apr 2015 14:55:38 +0200
|
||||
Subject: [PATCH] usr-arch.diff
|
||||
|
||||
===================================================================
|
||||
---
|
||||
BinariesCheck.py | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/BinariesCheck.py
|
||||
@@ -321,6 +321,7 @@ usr_lib_exception_regex = re.compile(Con
|
||||
srcname_regex = re.compile(r'(.*?)-[0-9]')
|
||||
invalid_dir_ref_regex = re.compile(r'/(home|tmp)(\W|$)')
|
||||
ocaml_mixed_regex = re.compile(r'^Caml1999X0\d\d$')
|
||||
+usr_arch_share_regex = re.compile(r'/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64|m68k|arm|aarch64)')
|
||||
|
||||
|
||||
def dir_base(path):
|
||||
@@ -394,7 +395,7 @@ class BinariesCheck(AbstractCheck.Abstra
|
||||
# arch dependent packages only from here on
|
||||
|
||||
# in /usr/share ?
|
||||
- if fname.startswith('/usr/share/'):
|
||||
+ if fname.startswith('/usr/share/') and not usr_arch_share_regex.search(fname):
|
||||
printError(pkg, 'arch-dependent-file-in-usr-share', fname)
|
||||
|
||||
# in /etc ?
|
@ -7,11 +7,11 @@ Subject: [PATCH] yast-provides.diff
|
||||
TagsCheck.py | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
Index: rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
Index: rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
===================================================================
|
||||
--- rpmlint-rpmlint-1.10.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.10/TagsCheck.py
|
||||
@@ -859,7 +859,7 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
--- rpmlint-rpmlint-1.11.orig/TagsCheck.py
|
||||
+++ rpmlint-rpmlint-1.11/TagsCheck.py
|
||||
@@ -866,7 +866,7 @@ class TagsCheck(AbstractCheck.AbstractCh
|
||||
printWarning(pkg, 'no-url-tag')
|
||||
|
||||
obs_names = [x[0] for x in pkg.obsoletes()]
|
||||
|
Loading…
Reference in New Issue
Block a user