From 1cdbc13b57a22d15fd29342947c42f53b62b81cc263dfeb76ccfc2941565f280 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 11:35:09 +0000 Subject: [PATCH 01/34] - update to 1.10: * test: Skip fedoradev GPG checks at least for now * test: Refresh fedora* packages on image build * test: Use assertEqual where appropriate, thanks to flake8/hacking * test: Update fedora24 config to fedora26, run it on Travis * Add a new test for tmpfiles.d snippets in the /etc/ tree. * Add new tests for systemd units and udev rules in /etc/ tree * test: Disable hacking for now until it's flake8 3.4+ compatible * test: Set up flake8-bugbear, enable it in fedoradev container * rpmlint: Avoid unused loop control variable * ZipCheck: Add TODO * *: Avoid mutable argument defaults * Be aware of -debugsource packages * rpmdiff: Fix unused variable from previous commit * rpmdiff: Support soft dependencies * BinariesCheck, FilesCheck: Ignore various .build-id dirs * Add python3-devel and rpm-build to fedoradev container to provoke some issues * BinariesCheck: Popen env consistency fix * Pkg.getstatusoutput: Set LC_ALL for all Popens, defaulting to C * rpmlint: Fix checking specfile from stdin * test.sh: Extract rpmlint command to run_rpmlint * Revert "Remove unused spec_lines check_spec argument" * BinariesCheck: Trivial cleanups * travis: Run make install too * FilesCheck: Allow multiple bytecode magic values per Python version * tests: Make output test tools easier to reuse * FilesCheck: hg.python.org -> github.com/python * Pkg: Return vendor and distribution as unicode strings * FilesCheck: Add Python 3.7 bytecode magic value * Pkg.b2s: Add some more test cases OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=482 --- ...ing-with-the-error-encoding-Fixes-61.patch | 50 -- ...g-Python-source-from-3.5-.opt-12.pyc.patch | 50 -- ...iesCheck_fix_chroot_check_on_non_x86.patch | 38 -- README.packaging.txt | 5 - add-check-for-tmpfiles-created-at-r.diff | 19 +- add-weak-dependencies.diff | 32 +- better-wrong-script.diff | 22 +- binaryinfo-speedup.diff | 126 ----- boo1027577-license_tag.patch | 13 - buildroot-doc.diff | 10 +- buildroot-in-scripts.diff | 10 +- check-for-self-provides.diff | 14 +- compressed-backup-regex.diff | 22 +- description-check.diff | 12 +- devel-provide-is-devel-package.diff | 10 +- docdata-examples.diff | 30 +- fix-shared-library-matching.diff | 34 -- invalid-filerequires.diff | 16 +- issue_68_BinariesCheck_lower_memory-1.patch | 37 -- issue_68_BinariesCheck_lower_memory-2.patch | 83 --- issue_68_BinariesCheck_lower_memory-3.patch | 35 -- issue_68_BinariesCheck_lower_memory-4.patch | 22 - libtool-wrapper-check.diff | 12 +- no-badness-return.diff | 20 +- no-doc-for-lib.diff | 10 +- noarch-lib64.diff | 16 +- omit_BUILDROOT_from_pyo_files.patch | 14 - only-reg-files-are-scripts.diff | 20 +- postin-speedup.diff | 47 -- remove-expand-macros.diff | 64 --- remove-files-attr-not-set-check.diff | 55 -- rpmgroup-checks.diff | 12 +- rpmlint-1.10.tar.gz | 3 + rpmlint-1.8.tar.gz | 3 - rpmlint-all-pie.patch | 10 +- rpmlint-pkg-quoting.diff | 22 - rpmlint-suse.diff | 34 +- rpmlint.changes | 161 ++++++ rpmlint.spec | 33 +- script-interpreter-only-for-exec-sc.diff | 22 - selfconflicts-provide.diff | 14 +- sourced-dirs.diff | 22 - stricter-interpreter-check.diff | 14 +- suse-binarieschecks.diff | 48 +- suse-check-optional-dependencies.diff | 12 +- suse-filesystem.diff | 501 ------------------ suse-filter-exception.diff | 16 +- suse-filter-more-verbose.diff | 12 +- suse-g-ir-chech.diff | 22 - suse-ignore-specfile-errors.diff | 10 +- suse-manpages-for-rc-scripts.diff | 12 +- suse-no-run-ldconfig.diff | 12 +- suse-pkg-config-check.diff | 24 +- suse-python3-naming-policy.diff | 12 +- suse-readd_terminator_in_regex.patch | 24 - suse-shlib-devel-dependency.diff | 16 +- suse-spdx-license-exceptions.patch | 26 +- suse-sysv-init-checks.diff | 82 --- suse-tests-without-badness.patch | 47 ++ suse-url-check.diff | 12 +- suse-version.diff | 30 +- update_git.sh | 151 ------ usr-arch.diff | 18 +- version-control-internal-file.diff | 22 - xdg-paths-update.diff | 14 +- yast-provides.diff | 10 +- 66 files changed, 536 insertions(+), 1895 deletions(-) delete mode 100644 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch delete mode 100644 0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch delete mode 100644 BinariesCheck_fix_chroot_check_on_non_x86.patch delete mode 100644 binaryinfo-speedup.diff delete mode 100644 boo1027577-license_tag.patch delete mode 100644 fix-shared-library-matching.diff delete mode 100644 issue_68_BinariesCheck_lower_memory-1.patch delete mode 100644 issue_68_BinariesCheck_lower_memory-2.patch delete mode 100644 issue_68_BinariesCheck_lower_memory-3.patch delete mode 100644 issue_68_BinariesCheck_lower_memory-4.patch delete mode 100644 omit_BUILDROOT_from_pyo_files.patch delete mode 100644 postin-speedup.diff delete mode 100644 remove-expand-macros.diff delete mode 100644 remove-files-attr-not-set-check.diff create mode 100644 rpmlint-1.10.tar.gz delete mode 100644 rpmlint-1.8.tar.gz delete mode 100644 rpmlint-pkg-quoting.diff delete mode 100644 script-interpreter-only-for-exec-sc.diff delete mode 100644 sourced-dirs.diff delete mode 100644 suse-filesystem.diff delete mode 100644 suse-g-ir-chech.diff delete mode 100644 suse-readd_terminator_in_regex.patch delete mode 100644 suse-sysv-init-checks.diff create mode 100644 suse-tests-without-badness.patch delete mode 100644 update_git.sh delete mode 100644 version-control-internal-file.diff diff --git a/0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch b/0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch deleted file mode 100644 index d6bea15..0000000 --- a/0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 8169818dbad3f8f6fccbc7e3de99e86b37ad45f6 Mon Sep 17 00:00:00 2001 -From: Dirk Mueller -Date: Mon, 22 Feb 2016 09:12:39 +0100 -Subject: [PATCH] Solve exceptions on printing str (Fixes #61) - -Handle printing of str gracefully by first encoding -it to unicode before printing it in the proper encoding. -Also fix python2 check. ---- - Filter.py | 28 ++++++++++++++-------------- - 1 file changed, 14 insertions(+), 14 deletions(-) - -Index: rpmlint-rpmlint-1.8/Filter.py -=================================================================== ---- rpmlint-rpmlint-1.8.orig/Filter.py -+++ rpmlint-rpmlint-1.8/Filter.py -@@ -24,20 +24,20 @@ _diagnostic = list() - _badness_score = 0 - printed_messages = {"I": 0, "W": 0, "E": 0} - --if sys.stdout.isatty(): -- def __print(s): -- print(s) --else: -- __stdout = sys.stdout -- if not __stdout.encoding: # Python < 3 only? -- import codecs -- if hasattr(__stdout, "buffer"): -- __stdout = __stdout.buffer -- __stdout = codecs.getwriter( -- locale.getpreferredencoding())(__stdout, "replace") -+__stdout = sys.stdout -+__preferred_encoding = locale.getpreferredencoding() -+if hasattr(__stdout, 'xreadlines'): # Python < 3 only -+ import codecs -+ if hasattr(__stdout, "buffer"): -+ __stdout = __stdout.buffer -+ __stdout = codecs.getwriter( -+ __preferred_encoding)(sys.stdout, 'replace') - -- def __print(s): -- print(s, file=__stdout) -+ -+def __print(s): -+ if isinstance(s, str) and hasattr(s, 'decode'): -+ s = s.decode(__preferred_encoding, 'replace') -+ print(s, file=__stdout) - - - def printInfo(pkg, reason, *details): diff --git a/0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch b/0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch deleted file mode 100644 index 034fb69..0000000 --- a/0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3b0286ba7f2192807b6d1eadf1fe7c46cc364854 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Skytt=C3=A4?= -Date: Sun, 29 Nov 2015 22:13:14 +0200 -Subject: [PATCH] Fix resolving Python source from 3.5 *.opt-[12].pyc - -https://bugzilla.redhat.com/show_bug.cgi?id=1286382 ---- - FilesCheck.py | 2 +- - test/test_files.py | 19 +++++++++++++++++++ - 2 files changed, 20 insertions(+), 1 deletion(-) - create mode 100644 test/test_files.py - -diff --git a/FilesCheck.py b/FilesCheck.py -index 977b47f..76b8f89 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -211,7 +211,7 @@ - normal_zero_length_regex = re.compile('^/etc/security/console\.apps/|/\.nosearch$|/__init__\.py$') - perl_regex = re.compile('^/usr/lib/perl5/(?:vendor_perl/)?([0-9]+\.[0-9]+)\.([0-9]+)/') - python_regex = re.compile('^/usr/lib(?:64)?/python([.0-9]+)/') --python_bytecode_regex_pep3147 = re.compile('^(.*)/__pycache__/(.*)\.(.*)(\.py[oc])$') -+python_bytecode_regex_pep3147 = re.compile('^(.*)/__pycache__/(.*?)\.([^.]+)(\.opt-[12])?\.py[oc]$') - python_bytecode_regex = re.compile('^(.*)(\.py[oc])$') - python_default_version = Config.getOption('PythonDefaultVersion', None) - perl_version_trick = Config.getOption('PerlVersionTrick', True) -diff --git a/test/test_files.py b/test/test_files.py -new file mode 100644 -index 0000000..84359d2 ---- /dev/null -+++ b/test/test_files.py -@@ -0,0 +1,19 @@ -+from FilesCheck import python_bytecode_to_script as pbts -+ -+ -+class TestPythonBytecodeToScript(object): -+ -+ def test_pep3147(self): -+ assert pbts("/usr/lib64/python3.4/__pycache__/__phello__.foo.cpython-34.pyc") == "/usr/lib64/python3.4/__phello__.foo.py" -+ assert pbts("/usr/lib64/python3.4/__pycache__/__phello__.foo.cpython-34.pyo") == "/usr/lib64/python3.4/__phello__.foo.py" -+ -+ def test_py2(self): -+ assert pbts("/usr/lib/python2.7/site-packages/_pytest/main.pyc") == "/usr/lib/python2.7/site-packages/_pytest/main.py" -+ assert pbts("/usr/lib/python2.7/site-packages/_pytest/main.pyo") == "/usr/lib/python2.7/site-packages/_pytest/main.py" -+ -+ def test_pep0488(self): -+ assert pbts("/usr/lib/python3.5/site-packages/__pycache__/pytest.cpython-35.opt-1.pyc") == "/usr/lib/python3.5/site-packages/pytest.py" -+ assert pbts("/usr/lib/python3.5/site-packages/__pycache__/pytest.cpython-35.opt-2.pyc") == "/usr/lib/python3.5/site-packages/pytest.py" -+ assert pbts("/usr/lib/python3.5/site-packages/__pycache__/pytest.cpython-35.pyc") == "/usr/lib/python3.5/site-packages/pytest.py" -+ -+# ex: ts=4 sw=4 et diff --git a/BinariesCheck_fix_chroot_check_on_non_x86.patch b/BinariesCheck_fix_chroot_check_on_non_x86.patch deleted file mode 100644 index 5296282..0000000 --- a/BinariesCheck_fix_chroot_check_on_non_x86.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/usr/share/rpmlint/BinariesCheck.py b/tmp/BinariesCheck.py -index 6e50c03..460c003 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -64,8 +64,6 @@ class BinaryInfo: - setuid_call_regex = create_regexp_call(['setresuid', 'seteuid', 'setuid']) - setgroups_call_regex = create_regexp_call(['initgroups', 'setgroups']) - chroot_call_regex = create_regexp_call('chroot') -- # 401eb8: e8 c3 f0 ff ff callq 400f80 -- objdump_call_regex = re.compile(b'callq?\s(.*)') - - forbidden_functions = Config.getOption("WarnOnFunction") - if forbidden_functions: -@@ -109,6 +107,12 @@ class BinaryInfo: - self.mktemp = False - - is_debug = path.endswith('.debug') -+ if pkg.arch in ['armv6hl', 'armv7hl', 'aarch64']: -+ # 10450: ebffffec bl 10408 -+ BinaryInfo.objdump_call_regex = re.compile(b'\sbl\s+(.*)') -+ else: # x86_64, ix86 -+ # 401eb8: e8 c3 f0 ff ff callq 400f80 -+ BinaryInfo.objdump_call_regex = re.compile(b'callq?\s(.*)') - - cmd = ['env', 'LC_ALL=C', 'readelf', '-W', '-S', '-l', '-d', '-s'] - cmd.append(path) -@@ -234,6 +238,11 @@ class BinaryInfo: - # check if chroot is near chdir (since otherwise, chroot is called - # without chdir) - if self.chroot and self.chdir: -+ if pkg.arch in ['ppc', 'ppc64', 'ppc64le']: -+ # On 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 -+ pass - p = subprocess.Popen( - ['env', 'LC_ALL=C', 'objdump', '-d', path], - stdout=subprocess.PIPE, bufsize=-1) diff --git a/README.packaging.txt b/README.packaging.txt index e2476e1..87cae85 100644 --- a/README.packaging.txt +++ b/README.packaging.txt @@ -1,8 +1,3 @@ -= rpmlint = - -The patches for rpmlint can be managed in git. That is especially -useful when rebasing to a new rpmlint version. Read update_git.sh - = rpmlint-checks, rpmlint-tests = The files from rpmlint-checks and rpmlint-tests managed in git. If diff --git a/add-check-for-tmpfiles-created-at-r.diff b/add-check-for-tmpfiles-created-at-r.diff index 899a669..ade19ed 100644 --- a/add-check-for-tmpfiles-created-at-r.diff +++ b/add-check-for-tmpfiles-created-at-r.diff @@ -14,11 +14,11 @@ complain about ghost files handled by the tmpfiles mechanism. 2 files changed, 111 insertions(+), 18 deletions(-) create mode 100644 TmpFilesCheck.py -diff --git a/PostCheck.py b/PostCheck.py -index 20b515e..6836359 100644 ---- a/PostCheck.py -+++ b/PostCheck.py -@@ -112,20 +112,6 @@ class PostCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/PostCheck.py +=================================================================== +--- 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) @@ -39,7 +39,7 @@ index 20b515e..6836359 100644 def check_aux(self, pkg, files, prog, script, tag, prereq): if script: if prog: -@@ -194,10 +180,6 @@ class PostCheck(AbstractCheck.AbstractCheck): +@@ -195,10 +181,6 @@ class PostCheck(AbstractCheck.AbstractCh check = PostCheck() # Add information about checks @@ -50,11 +50,10 @@ index 20b515e..6836359 100644 for scriptlet in map(lambda x: '%' + x, RPM_SCRIPTLETS): addDetails( 'one-line-command-in-%s' % scriptlet, -diff --git a/TmpFilesCheck.py b/TmpFilesCheck.py -new file mode 100644 -index 0000000..d1ef824 +Index: rpmlint-rpmlint-1.10/TmpFilesCheck.py +=================================================================== --- /dev/null -+++ b/TmpFilesCheck.py ++++ rpmlint-rpmlint-1.10/TmpFilesCheck.py @@ -0,0 +1,111 @@ +# -*- coding: utf-8 -*- +############################################################################# diff --git a/add-weak-dependencies.diff b/add-weak-dependencies.diff index 6aa39b4..ee557df 100644 --- a/add-weak-dependencies.diff +++ b/add-weak-dependencies.diff @@ -8,11 +8,11 @@ Subject: [PATCH] add-weak-dependencies.diff TagsCheck.py | 19 +++++++++++++++++++ 2 files changed, 46 insertions(+), 2 deletions(-) -diff --git a/Pkg.py b/Pkg.py -index 8884dce..360ec39 100644 ---- a/Pkg.py -+++ b/Pkg.py -@@ -475,6 +475,10 @@ class Pkg(AbstractPkg): +Index: rpmlint-rpmlint-1.10/Pkg.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/Pkg.py ++++ rpmlint-rpmlint-1.10/Pkg.py +@@ -494,6 +494,10 @@ class Pkg(AbstractPkg): self._missingok_files = None self._files = None self._requires = None @@ -23,7 +23,7 @@ index 8884dce..360ec39 100644 self._req_names = -1 if header: -@@ -730,6 +734,22 @@ class Pkg(AbstractPkg): +@@ -771,6 +775,22 @@ class Pkg(AbstractPkg): self._gatherDepInfo() return self._requires @@ -44,9 +44,9 @@ index 8884dce..360ec39 100644 + return self._enhances + def prereq(self): - """Get package PreReqs as list of - (name, flags, (epoch, version, release)) tuples.""" -@@ -790,7 +810,7 @@ class Pkg(AbstractPkg): + """ + Get package PreReqs as list of +@@ -845,7 +865,7 @@ class Pkg(AbstractPkg): # internal function to gather dependency info used by the above ones def _gather_aux(self, header, list, nametag, flagstag, versiontag, @@ -55,7 +55,7 @@ index 8884dce..360ec39 100644 names = header[nametag] flags = header[flagstag] versions = header[versiontag] -@@ -801,7 +821,11 @@ class Pkg(AbstractPkg): +@@ -856,7 +876,11 @@ class Pkg(AbstractPkg): evr = stringToVersion(b2s(versions[loop])) if prereq is not None and flags[loop] & PREREQ_FLAG: prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr)) @@ -68,7 +68,7 @@ index 8884dce..360ec39 100644 list.append((name, flags[loop], evr)) def _gatherDepInfo(self): -@@ -867,6 +891,7 @@ class Pkg(AbstractPkg): +@@ -924,6 +948,7 @@ class Pkg(AbstractPkg): return prog @@ -76,11 +76,11 @@ index 8884dce..360ec39 100644 def getInstalledPkgs(name): """Get list of installed package objects by name.""" -diff --git a/TagsCheck.py b/TagsCheck.py -index 13dbb95..00ec2e8 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -854,8 +854,27 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -899,8 +899,27 @@ class TagsCheck(AbstractCheck.AbstractCh value = Pkg.formatRequire(*c) self._unexpanded_macros(pkg, 'Conflicts %s' % (value,), value) diff --git a/better-wrong-script.diff b/better-wrong-script.diff index d5cfb30..fc8c37a 100644 --- a/better-wrong-script.diff +++ b/better-wrong-script.diff @@ -7,19 +7,19 @@ Subject: [PATCH] better-wrong-script.diff FilesCheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index ca3e96a..ad77589 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -1663,7 +1663,10 @@ executed.''', - executed.''', +Index: rpmlint-rpmlint-1.9/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.9.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.9/FilesCheck.py +@@ -1249,7 +1249,10 @@ executed.''', 'wrong-script-interpreter', --'''This script uses an incorrect interpreter.''', -+'''This script uses an incorrect interpreter. Correct interpreters should -+be an absolute path to a file in in /(s)bin or /usr/(s)bin. -+Alternatively, if the file isn't supposed to be executed, then don't -+mark it as executable. ''', + '''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 diff --git a/binaryinfo-speedup.diff b/binaryinfo-speedup.diff deleted file mode 100644 index f0e228b..0000000 --- a/binaryinfo-speedup.diff +++ /dev/null @@ -1,126 +0,0 @@ -From 4d995b87763076cc2aca25b7836e106708bd926f Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20Br=C3=BCns?= -Date: Fri, 23 Oct 2015 23:43:16 +0200 -Subject: [PATCH] Skip checks for problematic function calls if common prefix - does not match - -The regexes have a common prefix. If the prefix does not match, none of -the regexes will match, continue with the next line. ---- - BinariesCheck.py | 53 ++++++++++++++++++++++++++++++++--------------------- - 1 file changed, 32 insertions(+), 21 deletions(-) - -Index: rpmlint-rpmlint-1.8/BinariesCheck.py -=================================================================== ---- rpmlint-rpmlint-1.8.orig/BinariesCheck.py -+++ rpmlint-rpmlint-1.8/BinariesCheck.py -@@ -28,14 +28,14 @@ DEFAULT_SYSTEM_LIB_PATHS = ( - def create_regexp_call(call): - if type(call) == type([]): - call = '(?:' + '|'.join(call) + ')' -- r = "\s+FUNC\s+.*?\s+(%s(?:@GLIBC\S+)?)(?:\s|$)" % call -+ r = ".*?\s+(%s(?:@GLIBC\S+)?)(?:\s|$)" % call - return re.compile(r) - - - def create_nonlibc_regexp_call(call): - if type(call) == type([]): - call = '(?:' + '|'.join(call) + ')' -- r = "\s+FUNC\s+.*?\s+UND\s+(%s)\s?.*$" % call -+ r = ".*?\s+UND\s+(%s)\s?.*$" % call - return re.compile(r) - - -@@ -51,6 +51,7 @@ class BinaryInfo: - stack_exec_regex = re.compile('^..E$') - undef_regex = re.compile('^undefined symbol:\s+(\S+)') - unused_regex = re.compile('^\s+(\S+)') -+ call_regex = re.compile('\s0\s+FUNC\s+(.*)') - exit_call_regex = create_regexp_call('_?exit') - fork_call_regex = create_regexp_call('fork') - debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+') -@@ -109,25 +110,8 @@ class BinaryInfo: - cmd.append(path) - res = Pkg.getstatusoutput(cmd) - if not res[0]: -- for l in res[1].splitlines(): -- if BinaryInfo.mktemp_call_regex.search(l): -- self.mktemp = True -- -- if BinaryInfo.setgid_call_regex.search(l): -- self.setgid = True -- -- if BinaryInfo.setuid_call_regex.search(l): -- self.setuid = True -- -- if BinaryInfo.setgroups_call_regex.search(l): -- self.setgroups = True -- -- if BinaryInfo.chdir_call_regex.search(l): -- self.chdir = True -- -- if BinaryInfo.chroot_call_regex.search(l): -- self.chroot = True -- -+ lines = res[1].splitlines() -+ for l in lines: - r = BinaryInfo.needed_regex.search(l) - if r: - self.needed.append(r.group(1)) -@@ -160,6 +144,41 @@ class BinaryInfo: - self.exec_stack = True - continue - -+ if BinaryInfo.debuginfo_regex.search(l): -+ self.debuginfo=1 -+ continue -+ -+ if BinaryInfo.symtab_regex.search(l): -+ self.symtab=1 -+ continue -+ -+ if l.startswith("Symbol table"): -+ break -+ -+ for l in lines: -+ r = BinaryInfo.call_regex.search(l) -+ if not r: -+ continue -+ l = r.group(1) -+ -+ if BinaryInfo.mktemp_call_regex.search(l): -+ self.mktemp = True -+ -+ if BinaryInfo.setgid_call_regex.search(l): -+ self.setgid = True -+ -+ if BinaryInfo.setuid_call_regex.search(l): -+ self.setuid = True -+ -+ if BinaryInfo.setgroups_call_regex.search(l): -+ self.setgroups = True -+ -+ if BinaryInfo.chdir_call_regex.search(l): -+ self.chdir = True -+ -+ if BinaryInfo.chroot_call_regex.search(l): -+ self.chroot = True -+ - if BinaryInfo.forbidden_functions: - for r_name, func in BinaryInfo.forbidden_functions.items(): - ret = func['f_regex'].search(l) -@@ -181,14 +200,6 @@ class BinaryInfo: - fork_called = True - continue - -- if BinaryInfo.debuginfo_regex.search(l): -- self.debuginfo=1 -- continue -- -- if BinaryInfo.symtab_regex.search(l): -- self.symtab=1 -- continue -- - # check if we don't have a string that will automatically - # waive the presence of a forbidden call - if self.forbidden_calls: diff --git a/boo1027577-license_tag.patch b/boo1027577-license_tag.patch deleted file mode 100644 index 9024a69..0000000 --- a/boo1027577-license_tag.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: rpmlint-rpmlint-1.8/TagsCheck.py -=================================================================== ---- rpmlint-rpmlint-1.8.orig/TagsCheck.py -+++ rpmlint-rpmlint-1.8/TagsCheck.py -@@ -446,7 +446,7 @@ invalid_url_regex = re.compile(Config.ge - lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE) - leading_space_regex = re.compile('^\s+') - pkg_config_regex = re.compile('^/usr/(?:lib\d*|share)/pkgconfig/') --license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s') -+license_regex = re.compile('\(([^)]+)\)|\s(?:and|or|AND|OR)\s') - license_exception_regex = re.compile('(\S+)\sWITH\s(\S+)') - invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) - # () are here for grouping purpose in the regexp diff --git a/buildroot-doc.diff b/buildroot-doc.diff index 3de89bb..e6cd13a 100644 --- a/buildroot-doc.diff +++ b/buildroot-doc.diff @@ -7,11 +7,11 @@ Subject: [PATCH] buildroot-doc.diff SpecCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/SpecCheck.py b/SpecCheck.py -index 2e3ba56..62c5d9f 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -673,7 +673,7 @@ versions you can ignore this warning.''', +Index: rpmlint-rpmlint-1.10/SpecCheck.py +=================================================================== +--- 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 diff --git a/buildroot-in-scripts.diff b/buildroot-in-scripts.diff index d3c6f37..017ad32 100644 --- a/buildroot-in-scripts.diff +++ b/buildroot-in-scripts.diff @@ -7,11 +7,11 @@ Subject: [PATCH] buildroot-in-scripts.diff SpecCheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -diff --git a/SpecCheck.py b/SpecCheck.py -index 62c5d9f..8fc6e94 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -239,7 +239,9 @@ class SpecCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/SpecCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/SpecCheck.py ++++ rpmlint-rpmlint-1.10/SpecCheck.py +@@ -235,7 +235,9 @@ class SpecCheck(AbstractCheck.AbstractCh continue diff --git a/check-for-self-provides.diff b/check-for-self-provides.diff index 035ac6b..7deded1 100644 --- a/check-for-self-provides.diff +++ b/check-for-self-provides.diff @@ -6,11 +6,11 @@ Subject: [PATCH] check for self provides TagsCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/TagsCheck.py b/TagsCheck.py -index 8071f1d..39b7544 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -847,6 +847,8 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.9/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.9.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.9/TagsCheck.py +@@ -901,6 +901,8 @@ class TagsCheck(AbstractCheck.AbstractCh for p in pkg.provides(): value = Pkg.formatRequire(*p) self._unexpanded_macros(pkg, 'Provides %s' % (value,), value) @@ -19,7 +19,7 @@ index 8071f1d..39b7544 100644 for c in pkg.conflicts(): value = Pkg.formatRequire(*c) -@@ -1175,6 +1177,10 @@ objects should thus not be depended on and they should not result in provides +@@ -1252,6 +1254,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.''', @@ -29,4 +29,4 @@ index 8071f1d..39b7544 100644 +upgrade path. self-provides are autogenerated. Remove the provide.''', ) - for i in "obsoletes", "conflicts", "provides", "recommends", "suggests", \ + for i in ("obsoletes", "conflicts", "provides", "recommends", "suggests", diff --git a/compressed-backup-regex.diff b/compressed-backup-regex.diff index 686f668..f0351c1 100644 --- a/compressed-backup-regex.diff +++ b/compressed-backup-regex.diff @@ -7,16 +7,16 @@ Subject: [PATCH] compressed-backup-regex.diff FilesCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index a8ac7f4..f73cda1 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -599,7 +599,7 @@ DEFAULT_DISALLOWED_DIRS = ( +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('^(/usr)?/s?bin/\S+/') --backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.rej)$') -+backup_regex = re.compile('(~|\#[^/]+\#|\.orig|\.orig\.gz|\.rej)$') - compr_regex = re.compile('\.(gz|z|Z|zip|bz2|lzma|xz)$') - absolute_regex = re.compile('^/([^/]+)') - absolute2_regex = re.compile('^/?([^/]+)') + 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'^/?([^/]+)') diff --git a/description-check.diff b/description-check.diff index 7dabbea..a3c562e 100644 --- a/description-check.diff +++ b/description-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] description-check.diff TagsCheck.py | 7 +++++++ 1 file changed, 7 insertions(+) -diff --git a/TagsCheck.py b/TagsCheck.py -index 0a5f839..13dbb95 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -715,6 +715,9 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -746,6 +746,9 @@ class TagsCheck(AbstractCheck.AbstractCh else: for lang in langs: self.check_description(pkg, lang, ignored_words) @@ -21,7 +21,7 @@ index 0a5f839..13dbb95 100644 else: printError(pkg, 'no-description-tag') -@@ -1001,6 +1004,10 @@ Name tag.''', +@@ -1046,6 +1049,10 @@ Name tag.''', '''The major number of the library isn't included in the package's name. ''', diff --git a/devel-provide-is-devel-package.diff b/devel-provide-is-devel-package.diff index 09b7b2f..efb2dc4 100644 --- a/devel-provide-is-devel-package.diff +++ b/devel-provide-is-devel-package.diff @@ -7,11 +7,11 @@ Subject: [PATCH] devel-provide-is-devel-package.diff FilesCheck.py | 4 ++++ 1 file changed, 4 insertions(+) -diff --git a/FilesCheck.py b/FilesCheck.py -index ad77589..cdffaea 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -830,6 +830,10 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -422,6 +422,10 @@ class FilesCheck(AbstractCheck.AbstractC # Check if the package is a development package devel_pkg = devel_regex.search(pkg.name) diff --git a/docdata-examples.diff b/docdata-examples.diff index 521d324..6a35202 100644 --- a/docdata-examples.diff +++ b/docdata-examples.diff @@ -7,28 +7,28 @@ Subject: [PATCH] docdata-examples.diff FilesCheck.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 1011a25..ca3e96a 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -609,6 +609,7 @@ bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') - includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) - develfile_regex = re.compile('\.(a|cmxa?|mli?)$') - buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$') +Index: rpmlint-rpmlint-1.10/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 + 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)$') +docdir_examples_regex = re.compile('^/usr/(?:share/doc/packages|lib(?:64))/[^/]+/(?:example|demo|script|contrib)') # room for improvement with catching more -R, but also for false positives... - buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b') - sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$') -@@ -1184,7 +1185,7 @@ class FilesCheck(AbstractCheck.AbstractCheck): - includefile_regex.search(f) or \ - develfile_regex.search(f) or \ - logrotate_regex.search(f) + 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 + includefile_regex.search(f) or \ + develfile_regex.search(f) or \ + logrotate_regex.search(f) - if nonexec_file: + 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 \ f not in ghost_files: -@@ -1540,7 +1541,10 @@ included in your package.''', +@@ -1154,7 +1155,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 diff --git a/fix-shared-library-matching.diff b/fix-shared-library-matching.diff deleted file mode 100644 index ccada3a..0000000 --- a/fix-shared-library-matching.diff +++ /dev/null @@ -1,34 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:39 +0200 -Subject: [PATCH] fix shared library matching - -Avoids e.g. -[ 332s] glib2-devel.i586: E: library-without-ldconfig-postun (Badness: 300) /usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.4600.1-gdb.py ---- - FilesCheck.py | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/FilesCheck.py b/FilesCheck.py -index 81c5680..622b3b3 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -615,7 +615,9 @@ buildconfig_rpath_regex = re.compile('(?:-rpath|Wl,-R)\\b') - sofile_regex = re.compile('/lib(64)?/(.+/)?lib[^/]+\.so$') - devel_regex = re.compile('(.*)-(debug(info)?|devel|headers|source|static)$') - debuginfo_package_regex = re.compile('-debug(info)?$') --lib_regex = re.compile('lib(64)?/lib[^/]*(\.so\..*|-[0-9.]+\.so)') -+# matches properly versioned shared libraries like libfoo.so.1.2.3 as well as -+# weird ones like libfoo-1.2.3.so -+lib_regex = re.compile('/lib(?:64)?/lib[^/]*(?:\.so\.[\d.]+|-[\d.]+\.so)$') - ldconfig_regex = re.compile('^[^#]*ldconfig', re.MULTILINE) - depmod_regex = re.compile('^[^#]*depmod', re.MULTILINE) - install_info_regex = re.compile('^[^#]*install-info', re.MULTILINE) -@@ -1018,7 +1020,7 @@ class FilesCheck(AbstractCheck.AbstractCheck): - - # check ldconfig call in %post and %postun - if lib_regex.search(f): -- if devel_pkg: -+ if devel_pkg and not (sofile_regex.search(f) and stat.S_ISLNK(mode)): - printError(pkg, 'non-devel-file-in-devel-package', f) - if not postin: - printError(pkg, 'library-without-ldconfig-postin', f) diff --git a/invalid-filerequires.diff b/invalid-filerequires.diff index 2015a51..7c9871b 100644 --- a/invalid-filerequires.diff +++ b/invalid-filerequires.diff @@ -7,19 +7,19 @@ Subject: [PATCH] invalid-filerequires.diff TagsCheck.py | 10 ++++++++++ 1 file changed, 10 insertions(+) -diff --git a/TagsCheck.py b/TagsCheck.py -index 9856f9e..8071f1d 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -422,6 +422,7 @@ invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECA +Index: rpmlint-rpmlint-1.10/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 # () are here for grouping purpose in the regexp - forbidden_words_regex = re.compile('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE) + forbidden_words_regex = re.compile(r'(%s)' % Config.getOption('ForbiddenWords'), re.IGNORECASE) valid_buildhost_regex = re.compile(Config.getOption('ValidBuildHost')) +valid_filedep_regex=re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)') use_epoch = Config.getOption('UseEpoch', False) use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) max_line_len = Config.getOption('MaxLineLength', 79) -@@ -602,6 +603,9 @@ class TagsCheck(AbstractCheck.AbstractCheck): +@@ -642,6 +643,9 @@ class TagsCheck(AbstractCheck.AbstractCh if d[0].startswith('/usr/local/'): printError(pkg, 'invalid-dependency', d[0]) @@ -29,7 +29,7 @@ index 9856f9e..8071f1d 100644 if is_source: if lib_devel_number_regex.search(d[0]): printError(pkg, 'invalid-build-requires', d[0]) -@@ -1122,6 +1126,12 @@ unneeded explicit Requires: tags.''', +@@ -1199,6 +1203,12 @@ unneeded explicit Requires: tags.''', '''This package provides 2 times the same capacity. It should only provide it once.''', diff --git a/issue_68_BinariesCheck_lower_memory-1.patch b/issue_68_BinariesCheck_lower_memory-1.patch deleted file mode 100644 index 43ee3ee..0000000 --- a/issue_68_BinariesCheck_lower_memory-1.patch +++ /dev/null @@ -1,37 +0,0 @@ -From c5871542684bf1439d96f2430fe4f0010070e4db Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Ville=20Skytt=C3=A4?= -Date: Sun, 7 Feb 2016 10:10:51 +0200 -Subject: [PATCH] BinariesCheck: avoid false chroot w/o chdir when objdump - fails - -https://bugzilla.redhat.com/show_bug.cgi?id=1305302 ---- - BinariesCheck.py | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - -diff --git a/BinariesCheck.py b/BinariesCheck.py -index b2c030e..33dfae5 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -210,7 +210,10 @@ def __init__(self, pkg, path, file, is_ar, is_shlib): - # on a server like postfix - res = Pkg.getstatusoutput( - ('env', 'LC_ALL=C', 'objdump', '-d', path)) -- if not res[0]: -+ if res[0]: -+ printWarning(pkg, 'binaryinfo-objdump-failed', file) -+ self.chroot_near_chdir = True # avoid false positive -+ else: - call = [] - # we want that : - # 401eb8: e8 c3 f0 ff ff callq 400f80 -@@ -645,6 +648,9 @@ def check_binary(self, pkg): - 'binaryinfo-readelf-failed', - '''Executing readelf on this file failed, all checks could not be run.''', - -+'binaryinfo-objdump-failed', -+'''Executing objdump on this file failed, all checks could not be run.''', -+ - 'binaryinfo-tail-failed', - '''Reading trailing bytes of this file failed, all checks could not be run.''', - diff --git a/issue_68_BinariesCheck_lower_memory-2.patch b/issue_68_BinariesCheck_lower_memory-2.patch deleted file mode 100644 index 9587bcc..0000000 --- a/issue_68_BinariesCheck_lower_memory-2.patch +++ /dev/null @@ -1,83 +0,0 @@ -From be76ea6216987eefe9e863b193657318720bca51 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20Br=C3=BCns?= -Date: Sun, 13 Mar 2016 16:01:37 +0100 -Subject: [PATCH 1/3] BinariesCheck: lower memory requirements, fix - chroot/chdir detection - -Do not read whole output of objdump -d into memory, but read and process -the output while it is created (issue #67). -Also correct expression to find 'chdir@plt' in output (issue #66) ---- - BinariesCheck.py | 49 ++++++++++++++++++++++++++++++------------------- - 1 file changed, 30 insertions(+), 19 deletions(-) - -diff --git a/BinariesCheck.py b/BinariesCheck.py -index 33dfae5..ee6d00b 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -10,6 +10,7 @@ - import re - import stat - import sys -+import subprocess - - import rpm - -@@ -205,27 +206,37 @@ def __init__(self, pkg, path, file, is_ar, is_shlib): - # check if chroot is near chdir (since otherwise, chroot is called - # without chdir) - if self.chroot and self.chdir: -- # FIXME this check is too slow, because forking for objdump is -- # quite slow according to a quick test and that's quite visible -- # on a server like postfix -- res = Pkg.getstatusoutput( -- ('env', 'LC_ALL=C', 'objdump', '-d', path)) -- if res[0]: -+ p = subprocess.Popen( -+ ['env', 'LC_ALL=C', 'objdump', '-d', path], -+ stdout=subprocess.PIPE, bufsize=1) -+ with p.stdout: -+ # we want that : -+ # 401eb8: e8 c3 f0 ff ff callq 400f80 -+ objdump_call_regex = re.compile(b'callq?\s(.*)') -+ index = 0 -+ chroot_index = -99 -+ chdir_index = -99 -+ for line in p.stdout: -+ r = objdump_call_regex.search(line) -+ if not r: -+ continue -+ if b'@plt' not in r.group(1): -+ pass -+ elif b'chroot@plt' in r.group(1): -+ chroot_index = index -+ if abs(chroot_index - chdir_index) <= 2: -+ self.chroot_near_chdir = True -+ break -+ elif b'chdir@plt' in r.group(1): -+ chdir_index = index -+ if abs(chroot_index - chdir_index) <= 2: -+ self.chroot_near_chdir = True -+ break -+ index += 1 -+ if p.wait(): - printWarning(pkg, 'binaryinfo-objdump-failed', file) - self.chroot_near_chdir = True # avoid false positive -- else: -- call = [] -- # we want that : -- # 401eb8: e8 c3 f0 ff ff callq 400f80 -- for l in res[1].splitlines(): -- # call is for x86 32 bits, callq for x86_64 -- if l.find('callq ') >= 0 or l.find('call ') >= 0: -- call.append(l.rpartition(' ')[2]) -- for index, c in enumerate(call): -- if c.find('chroot@plt') >= 0: -- for i in call[index-2:index+2]: -- if i.find('chdir@plt'): -- self.chroot_near_chdir = True -+ - else: - self.readelf_error = True - printWarning(pkg, 'binaryinfo-readelf-failed', - diff --git a/issue_68_BinariesCheck_lower_memory-3.patch b/issue_68_BinariesCheck_lower_memory-3.patch deleted file mode 100644 index 5ce4778..0000000 --- a/issue_68_BinariesCheck_lower_memory-3.patch +++ /dev/null @@ -1,35 +0,0 @@ -From f61aab52fdcbdc9096f2346ee4ecf9668d8a0fbc Mon Sep 17 00:00:00 2001 -From: StefanBruens -Date: Wed, 29 Jun 2016 18:28:55 +0200 -Subject: [PATCH 2/3] Use default bufsize, move regex compile to common place - ---- - BinariesCheck.py | 7 +++---- - 1 file changed, 3 insertions(+), 4 deletions(-) - -Index: rpmlint-rpmlint-1.8/BinariesCheck.py -=================================================================== ---- rpmlint-rpmlint-1.8.orig/BinariesCheck.py -+++ rpmlint-rpmlint-1.8/BinariesCheck.py -@@ -64,6 +64,8 @@ class BinaryInfo: - setuid_call_regex = create_regexp_call(['setresuid', 'seteuid', 'setuid']) - setgroups_call_regex = create_regexp_call(['initgroups', 'setgroups']) - chroot_call_regex = create_regexp_call('chroot') -+ # 401eb8: e8 c3 f0 ff ff callq 400f80 -+ objdump_call_regex = re.compile(b'callq?\s(.*)') - - forbidden_functions = Config.getOption("WarnOnFunction") - if forbidden_functions: -@@ -234,11 +236,8 @@ class BinaryInfo: - if self.chroot and self.chdir: - p = subprocess.Popen( - ['env', 'LC_ALL=C', 'objdump', '-d', path], -- stdout=subprocess.PIPE, bufsize=1) -+ stdout=subprocess.PIPE, bufsize=-1) - with p.stdout: -- # we want that : -- # 401eb8: e8 c3 f0 ff ff callq 400f80 -- objdump_call_regex = re.compile(b'callq?\s(.*)') - index = 0 - chroot_index = -99 - chdir_index = -99 diff --git a/issue_68_BinariesCheck_lower_memory-4.patch b/issue_68_BinariesCheck_lower_memory-4.patch deleted file mode 100644 index 8a6486d..0000000 --- a/issue_68_BinariesCheck_lower_memory-4.patch +++ /dev/null @@ -1,22 +0,0 @@ -From 643f42c51f46ed1f377fc099cca818fba2d5a7d0 Mon Sep 17 00:00:00 2001 -From: StefanBruens -Date: Wed, 29 Jun 2016 18:38:51 +0200 -Subject: [PATCH 3/3] Fix last commit - ---- - BinariesCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/BinariesCheck.py b/BinariesCheck.py -index f19ae29..89517c2 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -216,7 +216,7 @@ def __init__(self, pkg, path, file, is_ar, is_shlib): - chroot_index = -99 - chdir_index = -99 - for line in p.stdout: -- r = objdump_call_regex.search(line) -+ r = BinaryInfo.objdump_call_regex.search(line) - if not r: - continue - if b'@plt' not in r.group(1): diff --git a/libtool-wrapper-check.diff b/libtool-wrapper-check.diff index 4f9b01a..b1dbabb 100644 --- a/libtool-wrapper-check.diff +++ b/libtool-wrapper-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] libtool-wrapper-check.diff BinariesCheck.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) -diff --git a/BinariesCheck.py b/BinariesCheck.py -index c7fadab..62951d6 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -359,8 +359,19 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/BinariesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py ++++ rpmlint-rpmlint-1.10/BinariesCheck.py +@@ -370,8 +370,19 @@ 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 @@ -31,7 +31,7 @@ index c7fadab..62951d6 100644 if not is_binary: if reference_regex.search(fname): lines = pkg.grep(invalid_dir_ref_regex, fname) -@@ -626,6 +637,15 @@ recompiled separately from the static libraries with the -fPIC option. +@@ -640,6 +651,15 @@ to list code compiled without -fPIC. Another common mistake that causes this problem is linking with ``gcc -Wl,-shared'' instead of ``gcc -shared''.''', diff --git a/no-badness-return.diff b/no-badness-return.diff index 31ec765..7985c31 100644 --- a/no-badness-return.diff +++ b/no-badness-return.diff @@ -8,11 +8,11 @@ Subject: [PATCH] no-badness-return.diff rpmlint | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -diff --git a/Filter.py b/Filter.py -index 5ce6219..e50abe1 100644 ---- a/Filter.py -+++ b/Filter.py -@@ -128,7 +128,7 @@ def printAllReasons(): +Index: rpmlint-rpmlint-1.10/Filter.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/Filter.py ++++ rpmlint-rpmlint-1.10/Filter.py +@@ -130,7 +130,7 @@ def printAllReasons(): if len(last_reason): printDescriptions(last_reason) last_reason = reason @@ -21,11 +21,11 @@ index 5ce6219..e50abe1 100644 if Config.info and len(last_reason): printDescriptions(last_reason) _diagnostic = list() -diff --git a/rpmlint b/rpmlint -index acbda29..810d677 100755 ---- a/rpmlint -+++ b/rpmlint -@@ -203,7 +203,7 @@ def main(): +Index: rpmlint-rpmlint-1.10/rpmlint +=================================================================== +--- rpmlint-rpmlint-1.10.orig/rpmlint ++++ rpmlint-rpmlint-1.10/rpmlint +@@ -206,7 +206,7 @@ def main(): % (packages_checked, specfiles_checked, printed_messages["E"], printed_messages["W"])) diff --git a/no-doc-for-lib.diff b/no-doc-for-lib.diff index 183bce6..19e3081 100644 --- a/no-doc-for-lib.diff +++ b/no-doc-for-lib.diff @@ -7,11 +7,11 @@ Subject: [PATCH] no-doc-for-lib.diff FilesCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 14ef030..ee5039c 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -847,7 +847,7 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.9/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.9.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.9/FilesCheck.py +@@ -434,7 +434,7 @@ class FilesCheck(AbstractCheck.AbstractC debuginfo_srcs = False debuginfo_debugs = False diff --git a/noarch-lib64.diff b/noarch-lib64.diff index 1c132f9..f94006b 100644 --- a/noarch-lib64.diff +++ b/noarch-lib64.diff @@ -7,11 +7,11 @@ Subject: [PATCH] noarch-lib64.diff BinariesCheck.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) -diff --git a/BinariesCheck.py b/BinariesCheck.py -index 62951d6..eb19387 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -337,6 +337,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/BinariesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py ++++ rpmlint-rpmlint-1.10/BinariesCheck.py +@@ -348,6 +348,7 @@ class BinariesCheck(AbstractCheck.Abstra binary = False binary_in_usr_lib = False has_usr_lib_file = False @@ -19,7 +19,7 @@ index 62951d6..eb19387 100644 multi_pkg = False srpm = pkg[rpm.RPMTAG_SOURCERPM] -@@ -355,6 +356,10 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +@@ -366,6 +367,10 @@ class BinariesCheck(AbstractCheck.Abstra # only-non-binary-in-usr-lib false positives binary_in_usr_lib = True @@ -30,7 +30,7 @@ index 62951d6..eb19387 100644 is_elf = 'ELF' in pkgfile.magic is_ar = 'current ar archive' in pkgfile.magic is_ocaml_native = 'Objective caml native' in pkgfile.magic -@@ -588,9 +593,12 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +@@ -599,9 +604,12 @@ class BinariesCheck(AbstractCheck.Abstra if version and version != -1 and version not in pkg.name: printError(pkg, 'incoherent-version-in-name', version) @@ -44,7 +44,7 @@ index 62951d6..eb19387 100644 if has_usr_lib_file and not binary_in_usr_lib: printWarning(pkg, 'only-non-binary-in-usr-lib') -@@ -614,6 +622,11 @@ FHS and the FSSTND forbid this.''', +@@ -626,6 +634,11 @@ FHS and the FSSTND forbid this.''', # 'non-sparc32-binary', # '', diff --git a/omit_BUILDROOT_from_pyo_files.patch b/omit_BUILDROOT_from_pyo_files.patch deleted file mode 100644 index b861e2e..0000000 --- a/omit_BUILDROOT_from_pyo_files.patch +++ /dev/null @@ -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 ; \ diff --git a/only-reg-files-are-scripts.diff b/only-reg-files-are-scripts.diff index 2bdf238..842e6c8 100644 --- a/only-reg-files-are-scripts.diff +++ b/only-reg-files-are-scripts.diff @@ -7,20 +7,20 @@ Subject: [PATCH] only-reg-files-are-scripts.diff InitScriptCheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/InitScriptCheck.py b/InitScriptCheck.py -index 0559405..f9b13a1 100644 ---- a/InitScriptCheck.py -+++ b/InitScriptCheck.py -@@ -18,7 +18,7 @@ from Filter import addDetails, printError, printWarning - import AbstractCheck +Index: rpmlint-rpmlint-1.10/InitScriptCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/InitScriptCheck.py ++++ rpmlint-rpmlint-1.10/InitScriptCheck.py +@@ -17,7 +17,7 @@ import AbstractCheck import Config + from Filter import addDetails, printError, printWarning import Pkg - +import stat - chkconfig_content_regex = re.compile('^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+') - subsys_regex = re.compile('/var/lock/subsys/([^/"\'\n\s;&|]+)', re.MULTILINE) -@@ -50,6 +50,9 @@ class InitScriptCheck(AbstractCheck.AbstractCheck): + chkconfig_content_regex = re.compile(r'^\s*#\s*chkconfig:\s*([-0-9]+)\s+[-0-9]+\s+[-0-9]+') + subsys_regex = re.compile(r'/var/lock/subsys/([^/"\'\s;&|]+)', re.MULTILINE) +@@ -49,6 +49,9 @@ class InitScriptCheck(AbstractCheck.Abst not fname.startswith('/etc/rc.d/init.d/'): continue @@ -29,4 +29,4 @@ index 0559405..f9b13a1 100644 + basename = os.path.basename(fname) initscript_list.append(basename) - if pkgfile.mode & int("500", 8) != int("500", 8): + if pkgfile.mode & 0o500 != 0o500: diff --git a/postin-speedup.diff b/postin-speedup.diff deleted file mode 100644 index 778e55f..0000000 --- a/postin-speedup.diff +++ /dev/null @@ -1,47 +0,0 @@ -From 1436dd7bc41115af658cf8f36a3149ab90a61fcf Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Stefan=20Br=C3=BCns?= -Date: Sun, 1 Nov 2015 19:32:57 +0100 -Subject: [PATCH] Expand postin/postun once per pkg instead once per file - ---- - FilesCheck.py | 20 ++++++++++---------- - 1 file changed, 10 insertions(+), 10 deletions(-) - -Index: rpmlint-rpmlint-1.8/FilesCheck.py -=================================================================== ---- rpmlint-rpmlint-1.8.orig/FilesCheck.py -+++ rpmlint-rpmlint-1.8/FilesCheck.py -@@ -863,6 +863,16 @@ class FilesCheck(AbstractCheck.AbstractC - elif debuginfo_package: - printError(pkg, 'empty-debuginfo-package') - -+ # Prefetch scriptlets, strip quotes from them (#169) -+ postin = pkg[rpm.RPMTAG_POSTIN] or \ -+ pkg.scriptprog(rpm.RPMTAG_POSTINPROG) -+ if postin: -+ postin = quotes_regex.sub('', postin) -+ postun = pkg[rpm.RPMTAG_POSTUN] or \ -+ pkg.scriptprog(rpm.RPMTAG_POSTUNPROG) -+ if postun: -+ postun = quotes_regex.sub('', postun) -+ - # Unique (rdev, inode) combinations - hardlinks = {} - -@@ -976,16 +986,6 @@ class FilesCheck(AbstractCheck.AbstractC - printError(pkg, 'non-standard-executable-perm', f, - "%o" % perm) - -- # Prefetch scriptlets, strip quotes from them (#169) -- postin = pkg[rpm.RPMTAG_POSTIN] or \ -- pkg.scriptprog(rpm.RPMTAG_POSTINPROG) -- if postin: -- postin = quotes_regex.sub('', postin) -- postun = pkg[rpm.RPMTAG_POSTUN] or \ -- pkg.scriptprog(rpm.RPMTAG_POSTUNPROG) -- if postun: -- postun = quotes_regex.sub('', postun) -- - if not devel_pkg: - if lib_path_regex.search(f): - lib_file = True diff --git a/remove-expand-macros.diff b/remove-expand-macros.diff deleted file mode 100644 index a856b4f..0000000 --- a/remove-expand-macros.diff +++ /dev/null @@ -1,64 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:40 +0200 -Subject: [PATCH] remove-expand-macros.diff - -commit 29e43a3e1676aa452f730a741d00ef4ac7baec96 -Author: Ludwig Nussel -Date: Tue May 17 12:56:38 2011 +0200 - - remove-expand-macros.diff ---- - TagsCheck.py | 27 --------------------------- - 1 file changed, 27 deletions(-) - -diff --git a/TagsCheck.py b/TagsCheck.py -index f229a28..3f9c0bc 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -432,15 +432,6 @@ so_dep_regex = re.compile(r'\.so(\.[0-9a-zA-z]+)*(\([^)]*\))*$') - # we assume that no rpm packages existed before rpm itself existed... - oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d")) - --private_so_paths = set() --for path in ('%perl_archlib', '%perl_vendorarch', '%perl_sitearch', -- '%python_sitearch', '%ruby_sitearch', '%php_extdir'): -- epath = rpm.expandMacro(path) -- if epath != path: -- private_so_paths.add(epath) -- private_so_paths.add(re.sub(r'/lib64(?=/|$)', '/lib', epath)) -- private_so_paths.add(re.sub(r'/lib(?=/|$)', '/lib64', epath)) -- - _enchant_checkers = {} - - -@@ -887,30 +878,12 @@ class TagsCheck(AbstractCheck.AbstractCheck): - (Pkg.formatRequire(*obs), - Pkg.formatRequire(*prov))) - -- expfmt = rpm.expandMacro("%{_build_name_fmt}") -- if pkg.isSource(): -- # _build_name_fmt often (always?) ends up not outputting src/nosrc -- # as arch for source packages, do it ourselves -- expfmt = re.sub(r'(?i)%\{?ARCH\b\}?', pkg.arch, expfmt) -- expected = pkg.header.sprintf(expfmt).split("/")[-1] -- basename = os.path.basename(pkg.filename) -- if basename != expected: -- printWarning(pkg, 'non-coherent-filename', basename, expected) -- - for tag in ('Distribution', 'DistTag', 'ExcludeArch', 'ExcludeOS', - 'Vendor'): - if hasattr(rpm, 'RPMTAG_%s' % tag.upper()): - self._unexpanded_macros(pkg, tag, - Pkg.b2s(pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())])) - -- for path in private_so_paths: -- for fname, pkgfile in pkg.files().items(): -- if fname.startswith(path): -- for prov in pkgfile.provides: -- if so_dep_regex.search(prov[0]): -- printWarning(pkg, "private-shared-object-provides", -- fname, Pkg.formatRequire(*prov)) -- - def check_description(self, pkg, lang, ignored_words): - description = pkg.langtag(rpm.RPMTAG_DESCRIPTION, lang) - if use_utf8: diff --git a/remove-files-attr-not-set-check.diff b/remove-files-attr-not-set-check.diff deleted file mode 100644 index b2be157..0000000 --- a/remove-files-attr-not-set-check.diff +++ /dev/null @@ -1,55 +0,0 @@ -From: Ludwig Nussel -Date: Tue, 19 May 2015 13:24:34 +0200 -Subject: [PATCH] remove files-attr-not-set check - -%defattr(-,root,root) is default since rpm 4.4, released > 10 -years go so it's about time to remove that check ---- - SpecCheck.py | 13 ------------- - 1 file changed, 13 deletions(-) - -diff --git a/SpecCheck.py b/SpecCheck.py -index 5149dc3..e00c0a8 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -64,7 +64,6 @@ biarch_package_regex = re.compile(DEFAULT_BIARCH_PACKAGES) - hardcoded_lib_path_exceptions_regex = re.compile(Config.getOption('HardcodedLibPathExceptions', DEFAULT_HARDCODED_LIB_PATH_EXCEPTIONS)) - use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) - libdir_regex = re.compile('%{?_lib(?:dir)?\}?\\b') --comment_or_empty_regex = re.compile('^\s*(#|$)') - defattr_regex = re.compile('^\s*%defattr\\b') - attr_regex = re.compile('^\s*%attr\\b') - suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)') -@@ -179,7 +178,6 @@ class SpecCheck(AbstractCheck.AbstractCheck): - patch_fuzz_override = False - indent_spaces = 0 - indent_tabs = 0 -- files_has_defattr = False - section = {} - # None == main package - current_package = None -@@ -231,9 +229,6 @@ class SpecCheck(AbstractCheck.AbstractCheck): - - if section_marker: - -- if current_section == 'files': -- files_has_defattr = False -- - if not is_lib_pkg and lib_package_regex.search(line): - is_lib_pkg = True - -@@ -471,14 +466,6 @@ class SpecCheck(AbstractCheck.AbstractCheck): - - if current_section == 'files': - -- if not comment_or_empty_regex.search(line) and not \ -- (ifarch_regex.search(line) or if_regex.search(line) or -- endif_regex.search(line)): -- if defattr_regex.search(line): -- files_has_defattr = True -- elif not (files_has_defattr or attr_regex.search(line)): -- printWarning(pkg, 'files-attr-not-set') -- - # TODO: check scriptlets for these too? - if package_noarch.get(current_package) or \ - (current_package not in package_noarch and diff --git a/rpmgroup-checks.diff b/rpmgroup-checks.diff index 7fdae7f..ba3b5c3 100644 --- a/rpmgroup-checks.diff +++ b/rpmgroup-checks.diff @@ -7,11 +7,11 @@ Subject: [PATCH] rpmgroup-checks.diff TagsCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) -diff --git a/TagsCheck.py b/TagsCheck.py -index dd09e62..0a5f839 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -722,6 +722,8 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -753,6 +753,8 @@ class TagsCheck(AbstractCheck.AbstractCh self._unexpanded_macros(pkg, 'Group', group) if not group: printError(pkg, 'no-group-tag') @@ -20,7 +20,7 @@ index dd09e62..0a5f839 100644 elif VALID_GROUPS and group not in VALID_GROUPS: printWarning(pkg, 'non-standard-group', group) -@@ -1040,6 +1042,10 @@ won't fool the specfile parser, and rebuild the package.''', +@@ -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.''', diff --git a/rpmlint-1.10.tar.gz b/rpmlint-1.10.tar.gz new file mode 100644 index 0000000..c1b2b4a --- /dev/null +++ b/rpmlint-1.10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e69290bebcce9581ba417c3db81cc5f51731927f0b7ea172b94446df8fab49cd +size 20763016 diff --git a/rpmlint-1.8.tar.gz b/rpmlint-1.8.tar.gz deleted file mode 100644 index 0fa1ade..0000000 --- a/rpmlint-1.8.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:ba78ad9ae556cad2590400935d406c4e5cb9cd88348d312b8f13561c76f5f105 -size 20275235 diff --git a/rpmlint-all-pie.patch b/rpmlint-all-pie.patch index b713752..a760bba 100644 --- a/rpmlint-all-pie.patch +++ b/rpmlint-all-pie.patch @@ -1,8 +1,8 @@ -Index: rpmlint-rpmlint-1.8/BinariesCheck.py +Index: rpmlint-rpmlint-1.10/BinariesCheck.py =================================================================== ---- rpmlint-rpmlint-1.8.orig/BinariesCheck.py -+++ rpmlint-rpmlint-1.8/BinariesCheck.py -@@ -560,6 +560,9 @@ class BinariesCheck(AbstractCheck.Abstra +--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py ++++ rpmlint-rpmlint-1.10/BinariesCheck.py +@@ -537,6 +537,9 @@ class BinariesCheck(AbstractCheck.Abstra if not is_shobj and pie_exec_re and pie_exec_re.search(fname): printError(pkg, 'non-position-independent-executable', fname) @@ -12,7 +12,7 @@ Index: rpmlint-rpmlint-1.8/BinariesCheck.py if bin_info.readelf_error: continue -@@ -809,6 +812,10 @@ stripping process.''', +@@ -789,6 +792,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.''', diff --git a/rpmlint-pkg-quoting.diff b/rpmlint-pkg-quoting.diff deleted file mode 100644 index cf52f7c..0000000 --- a/rpmlint-pkg-quoting.diff +++ /dev/null @@ -1,22 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:40 +0200 -Subject: [PATCH] rpmlint-pkg-quoting.diff - -=================================================================== ---- - Pkg.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Pkg.py b/Pkg.py -index 360ec39..aaa006f 100644 ---- a/Pkg.py -+++ b/Pkg.py -@@ -550,7 +550,7 @@ class Pkg(AbstractPkg): - dir=self.dirname) - # TODO: better shell escaping or sequence based command invocation - command_str = \ -- 'rpm2cpio "%s" | (cd "%s"; cpio -id); chmod -R +rX "%s"' % \ -+ "rpm2cpio '%s' | (cd '%s'; cpio -id); chmod -R +rX '%s'" % \ - (self.filename, self.dirname, self.dirname) - cmd = getstatusoutput(command_str, shell=True) - self.extracted = True diff --git a/rpmlint-suse.diff b/rpmlint-suse.diff index 3992216..12d73a0 100644 --- a/rpmlint-suse.diff +++ b/rpmlint-suse.diff @@ -8,23 +8,23 @@ Subject: [PATCH] rpmlint-suse.diff I18NCheck.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 7fcacbd..777f8aa 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -184,7 +184,7 @@ compr_regex = re.compile('\.(gz|z|Z|zip|bz2|lzma|xz)$') - absolute_regex = re.compile('^/([^/]+)') - absolute2_regex = re.compile('^/?([^/]+)') - points_regex = re.compile('^\.\./(.*)') --doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/') -+doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help') - bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') - includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) - develfile_regex = re.compile('\.(a|cmxa?|mli?)$') -diff --git a/I18NCheck.py b/I18NCheck.py -index 54b42cd..3bcf9d0 100644 ---- a/I18NCheck.py -+++ b/I18NCheck.py +Index: rpmlint-rpmlint-1.10/FilesCheck.py +=================================================================== +--- 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 + 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)/|^/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 +=================================================================== +--- rpmlint-rpmlint-1.10.orig/I18NCheck.py ++++ rpmlint-rpmlint-1.10/I18NCheck.py @@ -30,7 +30,7 @@ INCORRECT_LOCALES = { 'en_UK': 'en_GB'} diff --git a/rpmlint.changes b/rpmlint.changes index f9bab1e..c19266f 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,164 @@ +------------------------------------------------------------------- +Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com + +- update to 1.10: + * test: Skip fedoradev GPG checks at least for now + * test: Refresh fedora* packages on image build + * test: Use assertEqual where appropriate, thanks to flake8/hacking + * test: Update fedora24 config to fedora26, run it on Travis + * Add a new test for tmpfiles.d snippets in the /etc/ tree. + * Add new tests for systemd units and udev rules in /etc/ tree + * test: Disable hacking for now until it's flake8 3.4+ compatible + * test: Set up flake8-bugbear, enable it in fedoradev container + * rpmlint: Avoid unused loop control variable + * ZipCheck: Add TODO + * *: Avoid mutable argument defaults + * Be aware of -debugsource packages + * rpmdiff: Fix unused variable from previous commit + * rpmdiff: Support soft dependencies + * BinariesCheck, FilesCheck: Ignore various .build-id dirs + * Add python3-devel and rpm-build to fedoradev container to provoke some issues + * BinariesCheck: Popen env consistency fix + * Pkg.getstatusoutput: Set LC_ALL for all Popens, defaulting to C + * rpmlint: Fix checking specfile from stdin + * test.sh: Extract rpmlint command to run_rpmlint + * Revert "Remove unused spec_lines check_spec argument" + * BinariesCheck: Trivial cleanups + * travis: Run make install too + * FilesCheck: Allow multiple bytecode magic values per Python version + * tests: Make output test tools easier to reuse + * FilesCheck: hg.python.org -> github.com/python + * Pkg: Return vendor and distribution as unicode strings + * FilesCheck: Add Python 3.7 bytecode magic value + * Pkg.b2s: Add some more test cases + * Pkg.b2s: Pass through str as-is on Python 3 + * TagsCheck.py: accept SPDX "and" and "or" operators in all-uppercase spelling + * rb'foo' is not supported in Python 2, use br'foo' instead + * travis: Enable centos6 + * Avoid Python 3.6 invalid esc seq warnings, use more raw strings + * flake8 fixes + * SpecCheck: Detect patches applied with "patch <" and "patch -i" + * add /usr/lib/systemd to DEFAULT_HARDCODED_LIB_PATH_EXCEPTIONS (#93) + * SpecCheck: Do not demand versioned filename Provides/Obsoletes + * FilesCheck: Update Python 3.6 bytecode magic value again + * Config: Fix flake8 3.2 / pycodestyle 2.2 errors (closes #82) + * *: Fix various low hanging issues flagged by pycodestyle 2.1.0 (#82) + * test.sh: Output flake8 --version + * rpmdiff.1: update Arturo Borrero Gonzalez email address + * FilesCheck: Update Python 3.6 bytecode magic value + * Skip chroot-without-chdir check on non-x86_64 + * shlib-with-non-pic-code: add text on how to figure files compiled without -fPIC (#79) + * *: Move indentation etc settings to .editorconfig + * AbstractCheck: Close urllib responses explicitly also on error + * tests: Switch Travis tests to Docker + * Use importlib to load checks where available + * FilesCheck: Use os.devnull + * Testing: Avoid ResourceWarning on config read + * Run tests with warnings on + * Ignore negative returncode after SIGPIPE caused by closing on purpose + * Fix last commit + * Use default bufsize, move regex compile to common place + * BinariesCheck: lower memory requirements, fix chroot/chdir detection + * FilesCheck: Avoid crash accessing non-ASCII filenames in some cases + * Filter: More non-ASCII print fixing, including in e.g. C locale + * SpecCheck: Output spec basename, not tempfile when checking srpm + * Cleanups + * FilesCheck: Update Python 3.5 and 3.6 bytecode magic values + * test: Test for unexpected errors in default and C locales + * Remove obsolete LC_ALL setting from Makefile +- drop version-control-internal-file.diff, boo1027577-license_tag.patch: upstream +- drop sourced-dirs.diff, fix-shared-library-matching.diff: obsolete +- drop suse-readd_terminator_in_regex.patch: merged into original patch +- add suse-tests-without-badness.patch + +------------------------------------------------------------------- +Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com + +- update to 1.9: + * Pkg: Fix magic.descriptor availability check + * warn: Define only once, with print_function + * FilesCheck: Check for *.gir in devel, *.typelib in non-devel, fixes #74 + * FilesCheck: Improve devel-file-in-non-devel-package description + * flake8: Ignore H105 + * Makefile: Remove generate-isocodes dep from __isocodes__ + * __isocodes__: Regenerate + * generate-isocodes: Switch to JSON source files (#72) + * test.sh: Check man pages for warnings + * Delete dead if-block + * Filter: Line wrap cleanup + * Filter: Use sys.version_info to check Python version + * Fix octal string literals + * Solve exceptions on printing str (Fixes #61) + * tests: Add autofs binary rpm for testing non-ASCII output issues + * test: Add some test packages containing non-UTF-8 filenames + * BinariesCheck: avoid false chroot w/o chdir when objdump fails + * flake8 fixes + * rpmdiff: Import site only if needed + * Testing: Add and use default for path to tests + * FilesCheck: Update Python 3.6 bytecode magic value + * FilesCheck: Fix regression in finding shebangs without arguments + * Ignore .cache dir + * Clean up Python < 2.6 cruft + * Add hacking flake8 to Travis and ignores + * flake8 fixes + * Use new style classes + * Run flake8 on rpmdiff and rpmlint too + * Handle more file open/close with "with" + * Exception handling cleanups + * FilesCheck: Look for shebang only at start of file + * travis: python3-rpm doesn't exist even for Trusty, so can't test with 3.4 + * travis: Switch to Ubuntu Trusty, test with Python 2.7 and 3.4 + * Use Travis apt addon for whitelisted packages + * Test import order + * Sort imports per PEP8, Google Python Style Guide + * Add Python 3.6 magic value + * Fix resolving Python source from 3.5 *.opt-[12].pyc + * Move most Emacs settings to .dir-locals.el + * Add %python2_sitearch and %python3_sitearch to private SO paths + * Prevent empty paths from entering private SO paths + * remove files-attr-not-set check + * Expand postin/postun once per pkg instead once per file + * Install rpm in travis for signature check + * Avoid running some regexps + * Run flake8 in test suite + * flake8 fixes + * make test suite fail on more errors + * Comment update + * Note and test libmagic >= 5.05 dep + * Fix magic processing for Python 3 + * Mimic magic closer for symbolic links + * Workaround slowness due to python-magic bug + * Shortcut file magic, derive from file mode + * Spelling fix + * Unbreak create_*regex_call now that lines are shortened by call_regex + * Drop unnecessary symbol_table_regex + * Avoid false function call vs definition positives, thanks to Stefan Bruens + * pep8 fixes + * Add some pep8 settings + * Split parsing of readelf output into header and symbols part + * Skip checks for problematic function calls if common prefix does not match + * Use shlex.quote for better shell escaping where available + * TODO update + * Don't limit build badge to master branch + * Convert README to markdown + * Travis: install rpm2cpio + * +TODO + * Travis: Use Python 2.7 and system site packages + * Travis: try pytest from pip instead of apt-get + * Initial travis setup + * Include interpreter arguments in output messages for filtering control + * Flag /usr/bin/env as a wrong interpreter +- drop rpmlint-pkg-quoting.diff, suse-g-ir-chech.diff, remove-expand-macros.diff, + remove-files-attr-not-set-check.diff, postin-speedup.diff, binaryinfo-speedup.diff, + 0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch, + issue_68_BinariesCheck_lower_memory-1.patch, issue_68_BinariesCheck_lower_memory-2.patch, + issue_68_BinariesCheck_lower_memory-3.patch, issue_68_BinariesCheck_lower_memory-4.patch, + BinariesCheck_fix_chroot_check_on_non_x86.patch: either upstreamed as is or slightly different +- drop suse-sysv-init-checks.diff, 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch, + suse-filesystem.diff: obsolete +- drop update_git.sh related stuff: this is obsolete, patches are + either supposed to be upstreamed or handled via quilt + ------------------------------------------------------------------- Thu Sep 28 09:31:24 UTC 2017 - opensuse-packaging@opensuse.org diff --git a/rpmlint.spec b/rpmlint.spec index 8994d8b..8d793e7 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -21,12 +21,14 @@ Name: rpmlint BuildRequires: obs-service-format_spec_file BuildRequires: python-pytest +BuildRequires: python3-flake8 +BuildRequires: python3-rpm BuildRequires: rpm-python BuildRequires: xz Summary: Rpm correctness checker License: GPL-2.0+ Group: System/Packages -Version: 1.8 +Version: 1.10 Release: 0 Source0: https://github.com/rpm-software-management/rpmlint/archive/rpmlint-%{version}.tar.gz Source1: rpmlint-checks-master.tar.xz @@ -34,7 +36,6 @@ Source2: config Source3: config.in Source11: pie.config Source12: licenses.config -Source98: update_git.sh Source99: README.packaging.txt Source100: syntax-validator.py Url: https://github.com/rpm-software-management/rpmlint @@ -61,15 +62,13 @@ Patch01: suse-checks.diff Patch02: suse-version.diff Patch03: suse-url-check.diff Patch04: suse-python3-naming-policy.diff -Patch05: suse-filesystem.diff +Patch05: suse-tests-without-badness.patch Patch06: suse-pkg-config-check.diff Patch07: suse-binarieschecks.diff Patch08: no-doc-for-lib.diff Patch09: suse-filter-exception.diff Patch10: suse-spdx-license-exceptions.patch Patch20: usr-arch.diff -Patch21: script-interpreter-only-for-exec-sc.diff -Patch22: sourced-dirs.diff Patch23: suse-filter-more-verbose.diff Patch24: docdata-examples.diff Patch25: yast-provides.diff @@ -89,12 +88,8 @@ Patch38: add-weak-dependencies.diff Patch39: selfconflicts-provide.diff Patch40: no-badness-return.diff Patch41: suse-shlib-devel-dependency.diff -Patch42: version-control-internal-file.diff Patch43: stricter-interpreter-check.diff Patch44: confusing-invalid-spec-name.diff -Patch45: rpmlint-pkg-quoting.diff -Patch46: suse-g-ir-chech.diff -Patch47: remove-expand-macros.diff Patch48: suse-whitelist-opensuse.diff Patch49: extend-suse-conffiles-check.diff Patch50: compressed-backup-regex.diff @@ -103,28 +98,8 @@ Patch52: suse-python-abi-check.diff Patch53: suse-manpages-for-rc-scripts.diff Patch54: suse-ignore-specfile-errors.diff Patch55: invalid-filerequires.diff -Patch56: suse-sysv-init-checks.diff Patch57: check-for-self-provides.diff Patch58: add-check-for-tmpfiles-created-at-r.diff -Patch59: remove-files-attr-not-set-check.diff -Patch60: fix-shared-library-matching.diff -# https://github.com/rpm-software-management/rpmlint/commit/1436dd7bc41115af658cf8f36a3149ab90a61fcf.patch -Patch61: postin-speedup.diff -# https://github.com/rpm-software-management/rpmlint/commit/37fe9d4f237c2cb29fcb3b60d1ece189e578eeaf.patch and followup regression fixes -Patch62: binaryinfo-speedup.diff -Patch63: 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch -Patch64: omit_BUILDROOT_from_pyo_files.patch -# PATCH-FIX-UPSTREAM 0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch alarrosa@suse.com -- Fixes resolving python source from files generated following PEP0488 -Patch65: 0001-Fix-resolving-Python-source-from-3.5-.opt-12.pyc.patch -Patch661: issue_68_BinariesCheck_lower_memory-1.patch -Patch662: issue_68_BinariesCheck_lower_memory-2.patch -Patch663: issue_68_BinariesCheck_lower_memory-3.patch -Patch664: issue_68_BinariesCheck_lower_memory-4.patch -# Fix a regression introduced by suse-shlib-devel-dependency.diff -Patch67: suse-readd_terminator_in_regex.patch -Patch68: boo1027577-license_tag.patch -# Fix check for 'missing-call-to-chdir-with-chroot' on ARM, relax check on PPC -Patch69: BinariesCheck_fix_chroot_check_on_non_x86.patch Patch70: rpmlint-all-pie.patch # PATCHLIST END # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 diff --git a/script-interpreter-only-for-exec-sc.diff b/script-interpreter-only-for-exec-sc.diff deleted file mode 100644 index 3817ccf..0000000 --- a/script-interpreter-only-for-exec-sc.diff +++ /dev/null @@ -1,22 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:38 +0200 -Subject: [PATCH] script-interpreter-only-for-exec-scripts.diff - -=================================================================== ---- - FilesCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/FilesCheck.py b/FilesCheck.py -index ee5039c..4a698cd 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -1245,7 +1245,7 @@ class FilesCheck(AbstractCheck.AbstractCheck): - # ...but executed ones should - elif interpreter or mode_is_exec or script_regex.search(f): - if interpreter: -- if not interpreter_regex.search(interpreter): -+ if mode & 0o111 != 0 and not interpreter_regex.search(interpreter): - printError(pkg, 'wrong-script-interpreter', - f, interpreter) - elif not nonexec_file and not \ diff --git a/selfconflicts-provide.diff b/selfconflicts-provide.diff index 5929250..7bb096f 100644 --- a/selfconflicts-provide.diff +++ b/selfconflicts-provide.diff @@ -7,11 +7,11 @@ Subject: [PATCH] selfconflicts-provide.diff TagsCheck.py | 7 +++++++ 1 file changed, 7 insertions(+) -diff --git a/TagsCheck.py b/TagsCheck.py -index 00ec2e8..8dccbf1 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -830,6 +830,7 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -875,6 +875,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()] @@ -19,7 +19,7 @@ index 00ec2e8..8dccbf1 100644 for o in (x for x in obs_names if x not in prov_names): printWarning(pkg, 'obsolete-not-provided', o) -@@ -841,6 +842,8 @@ class TagsCheck(AbstractCheck.AbstractCheck): +@@ -886,6 +887,8 @@ class TagsCheck(AbstractCheck.AbstractCh # https://bugzilla.redhat.com/460872 useless_provides = [] for p in prov_names: @@ -28,7 +28,7 @@ index 00ec2e8..8dccbf1 100644 if prov_names.count(p) != 1 and p not in useless_provides: useless_provides.append(p) for p in useless_provides: -@@ -1003,6 +1006,10 @@ the Release tag.''', +@@ -1048,6 +1051,10 @@ the Release tag.''', '''There is no Name tag in your package. You have to specify a name using the Name tag.''', diff --git a/sourced-dirs.diff b/sourced-dirs.diff deleted file mode 100644 index 7115f76..0000000 --- a/sourced-dirs.diff +++ /dev/null @@ -1,22 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:38 +0200 -Subject: [PATCH] sourced-dirs.diff - -=================================================================== ---- - FilesCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/FilesCheck.py b/FilesCheck.py -index 4a698cd..1011a25 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -642,7 +642,7 @@ manifest_perl_regex = re.compile('^/usr/share/doc/perl-.*/MANIFEST(\.SKIP)?$') - shebang_regex = re.compile(b'^#!\s*(\S+)') - interpreter_regex = re.compile('^/(usr/)?(s?bin|games|libexec(/.+)?|(lib(64)?|share)/.+)/[^/]+$') - script_regex = re.compile('^/((usr/)?s?bin|etc/(rc\.d/init\.d|X11/xinit\.d|cron\.(hourly|daily|monthly|weekly)))/') --sourced_script_regex = re.compile('^/etc/(bash_completion\.d|profile\.d)/') -+sourced_script_regex = re.compile('^/etc/(bash_completion\.d|profile\.d|/sbin/conf.d)/') - use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) - skipdocs_regex = re.compile(Config.getOption('SkipDocsRegexp', '\.(?:rtf|x?html?|svg|ml[ily]?)$'), re.IGNORECASE) - meta_package_regex = re.compile(Config.getOption('MetaPackageRegexp', '^(bundle|task)-')) diff --git a/stricter-interpreter-check.diff b/stricter-interpreter-check.diff index 5f3d3e3..4f87cd6 100644 --- a/stricter-interpreter-check.diff +++ b/stricter-interpreter-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] stricter-interpreter-check.diff FilesCheck.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 59901e7..6c322c6 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -1268,7 +1268,8 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.9/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.9.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.9/FilesCheck.py +@@ -853,7 +853,8 @@ class FilesCheck(AbstractCheck.AbstractC f.endswith('.la')): printError(pkg, 'script-without-shebang', f) @@ -19,5 +19,5 @@ index 59901e7..6c322c6 100644 + if not mode_is_exec and not is_doc and \ + interpreter and interpreter.startswith("/"): printError(pkg, 'non-executable-script', f, - "%o" % perm, interpreter) - if b'\r' in chunk: + "%o" % perm, interpreter, + interpreter_args) diff --git a/suse-binarieschecks.diff b/suse-binarieschecks.diff index e1e4556..9bf46b0 100644 --- a/suse-binarieschecks.diff +++ b/suse-binarieschecks.diff @@ -7,31 +7,31 @@ Subject: [PATCH] suse-binarieschecks.diff BinariesCheck.py | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) -diff --git a/BinariesCheck.py b/BinariesCheck.py -index d2ed87a..2e5758e 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -14,7 +14,7 @@ import sys +Index: rpmlint-rpmlint-1.10/BinariesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py ++++ rpmlint-rpmlint-1.10/BinariesCheck.py +@@ -16,7 +16,7 @@ import rpm - import rpm - --from Filter import addDetails, printError, printWarning -+from Filter import addDetails, printError, printWarning, printInfo import AbstractCheck import Config +-from Filter import addDetails, printError, printWarning ++from Filter import addDetails, printError, printWarning, printInfo import Pkg -@@ -53,6 +53,10 @@ class BinaryInfo: - unused_regex = re.compile('^\s+(\S+)') - exit_call_regex = create_regexp_call('_?exit') - fork_call_regex = create_regexp_call('fork') + + +@@ -56,6 +56,10 @@ class BinaryInfo(object): + chroot_call_regex = create_regexp_call('chroot') + # 401eb8: e8 c3 f0 ff ff callq 400f80 + objdump_call_regex = re.compile(br'callq?\s(.*)') + debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+') + symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+') + gethostbyname_call_regex = create_regexp_call(['gethostbyname', 'gethostbyname2', + 'gethostbyaddr', 'gethostbyname_r', 'gethostbyname2_r', 'gethostbyaddr_r']) - # regexp for setgid setegid setresgid set(?:res|e)?gid - setgid_call_regex = create_regexp_call(['setresgid', 'setegid', 'setgid']) - setuid_call_regex = create_regexp_call(['setresuid', 'seteuid', 'setuid']) -@@ -86,7 +89,10 @@ class BinaryInfo: + + forbidden_functions = Config.getOption("WarnOnFunction") + if forbidden_functions: +@@ -84,7 +88,10 @@ class BinaryInfo(object): self.exec_stack = False self.exit_calls = [] self.forbidden_calls = [] @@ -42,7 +42,7 @@ index d2ed87a..2e5758e 100644 self.tail = '' self.setgid = False -@@ -160,6 +166,11 @@ class BinaryInfo: +@@ -167,6 +174,11 @@ class BinaryInfo(object): if ret: self.forbidden_calls.append(r_name) @@ -54,7 +54,7 @@ index d2ed87a..2e5758e 100644 if is_shlib: r = BinaryInfo.exit_call_regex.search(l) if r: -@@ -170,6 +181,14 @@ class BinaryInfo: +@@ -177,6 +189,14 @@ class BinaryInfo(object): fork_called = True continue @@ -69,7 +69,7 @@ index d2ed87a..2e5758e 100644 # check if we don't have a string that will automatically # waive the presence of a forbidden call if self.forbidden_calls: -@@ -382,13 +401,26 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +@@ -392,13 +412,26 @@ class BinariesCheck(AbstractCheck.Abstra continue # stripped ? @@ -97,7 +97,7 @@ index d2ed87a..2e5758e 100644 if is_shlib: has_lib = True -@@ -443,6 +475,10 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +@@ -453,6 +486,10 @@ class BinariesCheck(AbstractCheck.Abstra printWarning(pkg, ec, fname, BinaryInfo.forbidden_functions[ec]['f_name']) @@ -108,7 +108,7 @@ index d2ed87a..2e5758e 100644 # rpath ? if bin_info.rpath: for p in bin_info.rpath: -@@ -650,6 +686,14 @@ with the intended shared libraries only.''', +@@ -666,6 +703,14 @@ with the intended shared libraries only. 'ldd-failed', '''Executing ldd on this file failed, all checks could not be run.''', @@ -123,7 +123,7 @@ index d2ed87a..2e5758e 100644 '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 -@@ -662,6 +706,10 @@ don\'t define a proper .note.GNU-stack section.''', +@@ -678,6 +723,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.''', @@ -134,7 +134,7 @@ index d2ed87a..2e5758e 100644 '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 -@@ -680,6 +728,12 @@ that use prelink, make sure that prelink does not strip it either, usually by +@@ -696,6 +745,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''', diff --git a/suse-check-optional-dependencies.diff b/suse-check-optional-dependencies.diff index 1cbcf8e..5f6ffdf 100644 --- a/suse-check-optional-dependencies.diff +++ b/suse-check-optional-dependencies.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-check-optional-dependencies.diff FilesCheck.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) -diff --git a/FilesCheck.py b/FilesCheck.py -index cdffaea..aa1fa25 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -927,6 +927,16 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -535,6 +535,16 @@ class FilesCheck(AbstractCheck.AbstractC if res.group(1) != pkg.name: printError(pkg, 'incoherent-logrotate-file', f) @@ -28,7 +28,7 @@ index cdffaea..aa1fa25 100644 if link != '': ext = compr_regex.search(link) if ext: -@@ -1723,6 +1733,24 @@ consequences), or other compiler flags which result in rpmbuild's debuginfo +@@ -1338,6 +1348,24 @@ consequences), or other compiler flags w extraction not working as expected. Verify that the binaries are not unexpectedly stripped and that the intended compiler flags are used.''', diff --git a/suse-filesystem.diff b/suse-filesystem.diff deleted file mode 100644 index 8f73e27..0000000 --- a/suse-filesystem.diff +++ /dev/null @@ -1,501 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:38 +0200 -Subject: [PATCH] suse-filesystem.diff - -=================================================================== ---- - FilesCheck.py | 454 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--- - 1 file changed, 437 insertions(+), 17 deletions(-) - -diff --git a/FilesCheck.py b/FilesCheck.py -index 777f8aa..14ef030 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -102,24 +102,415 @@ STANDARD_DIRS = ( - '/usr/local/man/mann', - '/usr/local/sbin', - '/usr/local/share', -- '/usr/local/share/man', -- '/usr/local/share/man/man1', -- '/usr/local/share/man/man2', -- '/usr/local/share/man/man3', -- '/usr/local/share/man/man4', -- '/usr/local/share/man/man5', -- '/usr/local/share/man/man6', -- '/usr/local/share/man/man7', -- '/usr/local/share/man/man8', -- '/usr/local/share/man/man9', -- '/usr/local/share/man/mann', - '/usr/local/src', - '/usr/sbin', - '/usr/share', -+ '/usr/share/applications', - '/usr/share/dict', - '/usr/share/doc', -+ '/usr/share/doc/packages', -+ '/usr/share/fonts', -+ '/usr/share/games', - '/usr/share/icons', - '/usr/share/info', -+ '/usr/share/java', -+ '/usr/share/locale', -+ '/usr/share/locale/aa', -+ '/usr/share/locale/aa/LC_MESSAGES', -+ '/usr/share/locale/af', -+ '/usr/share/locale/af/LC_MESSAGES', -+ '/usr/share/locale/am', -+ '/usr/share/locale/am/LC_MESSAGES', -+ '/usr/share/locale/ang', -+ '/usr/share/locale/ang/LC_MESSAGES', -+ '/usr/share/locale/ar', -+ '/usr/share/locale/ar/LC_MESSAGES', -+ '/usr/share/locale/as', -+ '/usr/share/locale/as/LC_MESSAGES', -+ '/usr/share/locale/az', -+ '/usr/share/locale/az/LC_MESSAGES', -+ '/usr/share/locale/az_IR', -+ '/usr/share/locale/az_IR/LC_MESSAGES', -+ '/usr/share/locale/be', -+ '/usr/share/locale/be/LC_MESSAGES', -+ '/usr/share/locale/be@latin', -+ '/usr/share/locale/be@latin/LC_MESSAGES', -+ '/usr/share/locale/bg', -+ '/usr/share/locale/bg/LC_MESSAGES', -+ '/usr/share/locale/bn', -+ '/usr/share/locale/bn/LC_MESSAGES', -+ '/usr/share/locale/bn_IN', -+ '/usr/share/locale/bn_IN/LC_MESSAGES', -+ '/usr/share/locale/bo', -+ '/usr/share/locale/bo/LC_MESSAGES', -+ '/usr/share/locale/br', -+ '/usr/share/locale/br/LC_MESSAGES', -+ '/usr/share/locale/bs', -+ '/usr/share/locale/bs/LC_MESSAGES', -+ '/usr/share/locale/byn', -+ '/usr/share/locale/byn/LC_MESSAGES', -+ '/usr/share/locale/ca', -+ '/usr/share/locale/ca/LC_MESSAGES', -+ '/usr/share/locale/ca@valencia', -+ '/usr/share/locale/ca@valencia/LC_MESSAGES', -+ '/usr/share/locale/cs', -+ '/usr/share/locale/cs/LC_MESSAGES', -+ '/usr/share/locale/cs_CZ', -+ '/usr/share/locale/cs_CZ/LC_MESSAGES', -+ '/usr/share/locale/cy', -+ '/usr/share/locale/cy/LC_MESSAGES', -+ '/usr/share/locale/da', -+ '/usr/share/locale/da/LC_MESSAGES', -+ '/usr/share/locale/de', -+ '/usr/share/locale/de/LC_MESSAGES', -+ '/usr/share/locale/de_AT', -+ '/usr/share/locale/de_AT/LC_MESSAGES', -+ '/usr/share/locale/de_CH', -+ '/usr/share/locale/de_CH/LC_MESSAGES', -+ '/usr/share/locale/de_DE', -+ '/usr/share/locale/de_DE/LC_MESSAGES', -+ '/usr/share/locale/dv', -+ '/usr/share/locale/dv/LC_MESSAGES', -+ '/usr/share/locale/dz', -+ '/usr/share/locale/dz/LC_MESSAGES', -+ '/usr/share/locale/ee', -+ '/usr/share/locale/ee/LC_MESSAGES', -+ '/usr/share/locale/el', -+ '/usr/share/locale/el/LC_MESSAGES', -+ '/usr/share/locale/el_GR', -+ '/usr/share/locale/el_GR/LC_MESSAGES', -+ '/usr/share/locale/en', -+ '/usr/share/locale/en/LC_MESSAGES', -+ '/usr/share/locale/en@IPA', -+ '/usr/share/locale/en@IPA/LC_MESSAGES', -+ '/usr/share/locale/en@boldquot', -+ '/usr/share/locale/en@boldquot/LC_MESSAGES', -+ '/usr/share/locale/en@quot', -+ '/usr/share/locale/en@quot/LC_MESSAGES', -+ '/usr/share/locale/en_AU', -+ '/usr/share/locale/en_AU/LC_MESSAGES', -+ '/usr/share/locale/en_CA', -+ '/usr/share/locale/en_CA/LC_MESSAGES', -+ '/usr/share/locale/en_GB', -+ '/usr/share/locale/en_GB/LC_MESSAGES', -+ '/usr/share/locale/en_US', -+ '/usr/share/locale/en_US/LC_MESSAGES', -+ '/usr/share/locale/eo', -+ '/usr/share/locale/eo/LC_MESSAGES', -+ '/usr/share/locale/es', -+ '/usr/share/locale/es/LC_MESSAGES', -+ '/usr/share/locale/es_AR', -+ '/usr/share/locale/es_AR/LC_MESSAGES', -+ '/usr/share/locale/es_CL', -+ '/usr/share/locale/es_CL/LC_MESSAGES', -+ '/usr/share/locale/es_CO', -+ '/usr/share/locale/es_CO/LC_MESSAGES', -+ '/usr/share/locale/es_CR', -+ '/usr/share/locale/es_CR/LC_MESSAGES', -+ '/usr/share/locale/es_DO', -+ '/usr/share/locale/es_DO/LC_MESSAGES', -+ '/usr/share/locale/es_EC', -+ '/usr/share/locale/es_EC/LC_MESSAGES', -+ '/usr/share/locale/es_ES', -+ '/usr/share/locale/es_ES/LC_MESSAGES', -+ '/usr/share/locale/es_GT', -+ '/usr/share/locale/es_GT/LC_MESSAGES', -+ '/usr/share/locale/es_HN', -+ '/usr/share/locale/es_HN/LC_MESSAGES', -+ '/usr/share/locale/es_MX', -+ '/usr/share/locale/es_MX/LC_MESSAGES', -+ '/usr/share/locale/es_NI', -+ '/usr/share/locale/es_NI/LC_MESSAGES', -+ '/usr/share/locale/es_PA', -+ '/usr/share/locale/es_PA/LC_MESSAGES', -+ '/usr/share/locale/es_PE', -+ '/usr/share/locale/es_PE/LC_MESSAGES', -+ '/usr/share/locale/es_PR', -+ '/usr/share/locale/es_PR/LC_MESSAGES', -+ '/usr/share/locale/es_SV', -+ '/usr/share/locale/es_SV/LC_MESSAGES', -+ '/usr/share/locale/es_UY', -+ '/usr/share/locale/es_UY/LC_MESSAGES', -+ '/usr/share/locale/es_VE', -+ '/usr/share/locale/es_VE/LC_MESSAGES', -+ '/usr/share/locale/et', -+ '/usr/share/locale/et/LC_MESSAGES', -+ '/usr/share/locale/et_EE', -+ '/usr/share/locale/et_EE/LC_MESSAGES', -+ '/usr/share/locale/eu', -+ '/usr/share/locale/eu/LC_MESSAGES', -+ '/usr/share/locale/eu_ES', -+ '/usr/share/locale/eu_ES/LC_MESSAGES', -+ '/usr/share/locale/fa', -+ '/usr/share/locale/fa/LC_MESSAGES', -+ '/usr/share/locale/fi', -+ '/usr/share/locale/fi/LC_MESSAGES', -+ '/usr/share/locale/fi_FI', -+ '/usr/share/locale/fi_FI/LC_MESSAGES', -+ '/usr/share/locale/fo', -+ '/usr/share/locale/fo/LC_MESSAGES', -+ '/usr/share/locale/fr', -+ '/usr/share/locale/fr/LC_MESSAGES', -+ '/usr/share/locale/fr_CA', -+ '/usr/share/locale/fr_CA/LC_MESSAGES', -+ '/usr/share/locale/fr_CH', -+ '/usr/share/locale/fr_CH/LC_MESSAGES', -+ '/usr/share/locale/fr_FR', -+ '/usr/share/locale/fr_FR/LC_MESSAGES', -+ '/usr/share/locale/fy', -+ '/usr/share/locale/fy/LC_MESSAGES', -+ '/usr/share/locale/ga', -+ '/usr/share/locale/ga/LC_MESSAGES', -+ '/usr/share/locale/gd', -+ '/usr/share/locale/gd/LC_MESSAGES', -+ '/usr/share/locale/gez', -+ '/usr/share/locale/gez/LC_MESSAGES', -+ '/usr/share/locale/gl', -+ '/usr/share/locale/gl/LC_MESSAGES', -+ '/usr/share/locale/gn', -+ '/usr/share/locale/gn/LC_MESSAGES', -+ '/usr/share/locale/gr', -+ '/usr/share/locale/gr/LC_MESSAGES', -+ '/usr/share/locale/gu', -+ '/usr/share/locale/gu/LC_MESSAGES', -+ '/usr/share/locale/gv', -+ '/usr/share/locale/gv/LC_MESSAGES', -+ '/usr/share/locale/haw', -+ '/usr/share/locale/haw/LC_MESSAGES', -+ '/usr/share/locale/he', -+ '/usr/share/locale/he/LC_MESSAGES', -+ '/usr/share/locale/hi', -+ '/usr/share/locale/hi/LC_MESSAGES', -+ '/usr/share/locale/hr', -+ '/usr/share/locale/hr/LC_MESSAGES', -+ '/usr/share/locale/hu', -+ '/usr/share/locale/hu/LC_MESSAGES', -+ '/usr/share/locale/hy', -+ '/usr/share/locale/hy/LC_MESSAGES', -+ '/usr/share/locale/ia', -+ '/usr/share/locale/ia/LC_MESSAGES', -+ '/usr/share/locale/id', -+ '/usr/share/locale/id/LC_MESSAGES', -+ '/usr/share/locale/is', -+ '/usr/share/locale/is/LC_MESSAGES', -+ '/usr/share/locale/it', -+ '/usr/share/locale/it/LC_MESSAGES', -+ '/usr/share/locale/it_CH', -+ '/usr/share/locale/it_CH/LC_MESSAGES', -+ '/usr/share/locale/it_IT', -+ '/usr/share/locale/it_IT/LC_MESSAGES', -+ '/usr/share/locale/iu', -+ '/usr/share/locale/iu/LC_MESSAGES', -+ '/usr/share/locale/ja', -+ '/usr/share/locale/ja/LC_MESSAGES', -+ '/usr/share/locale/ja_JP.EUC', -+ '/usr/share/locale/ja_JP.EUC/LC_MESSAGES', -+ '/usr/share/locale/ja_JP.SJIS', -+ '/usr/share/locale/ja_JP.SJIS/LC_MESSAGES', -+ '/usr/share/locale/ja_JP.eucJP', -+ '/usr/share/locale/ja_JP.eucJP/LC_MESSAGES', -+ '/usr/share/locale/ka', -+ '/usr/share/locale/ka/LC_MESSAGES', -+ '/usr/share/locale/kk', -+ '/usr/share/locale/kk/LC_MESSAGES', -+ '/usr/share/locale/kl', -+ '/usr/share/locale/kl/LC_MESSAGES', -+ '/usr/share/locale/km', -+ '/usr/share/locale/km/LC_MESSAGES', -+ '/usr/share/locale/kn', -+ '/usr/share/locale/kn/LC_MESSAGES', -+ '/usr/share/locale/ko', -+ '/usr/share/locale/ko/LC_MESSAGES', -+ '/usr/share/locale/kok', -+ '/usr/share/locale/kok/LC_MESSAGES', -+ '/usr/share/locale/ku', -+ '/usr/share/locale/ku/LC_MESSAGES', -+ '/usr/share/locale/kw', -+ '/usr/share/locale/kw/LC_MESSAGES', -+ '/usr/share/locale/ky', -+ '/usr/share/locale/ky/LC_MESSAGES', -+ '/usr/share/locale/lg', -+ '/usr/share/locale/lg/LC_MESSAGES', -+ '/usr/share/locale/li', -+ '/usr/share/locale/li/LC_MESSAGES', -+ '/usr/share/locale/lo', -+ '/usr/share/locale/lo/LC_MESSAGES', -+ '/usr/share/locale/lt', -+ '/usr/share/locale/lt/LC_MESSAGES', -+ '/usr/share/locale/lv', -+ '/usr/share/locale/lv/LC_MESSAGES', -+ '/usr/share/locale/mg', -+ '/usr/share/locale/mg/LC_MESSAGES', -+ '/usr/share/locale/mi', -+ '/usr/share/locale/mi/LC_MESSAGES', -+ '/usr/share/locale/mk', -+ '/usr/share/locale/mk/LC_MESSAGES', -+ '/usr/share/locale/ml', -+ '/usr/share/locale/ml/LC_MESSAGES', -+ '/usr/share/locale/mn', -+ '/usr/share/locale/mn/LC_MESSAGES', -+ '/usr/share/locale/mr', -+ '/usr/share/locale/mr/LC_MESSAGES', -+ '/usr/share/locale/ms', -+ '/usr/share/locale/ms/LC_MESSAGES', -+ '/usr/share/locale/mt', -+ '/usr/share/locale/mt/LC_MESSAGES', -+ '/usr/share/locale/my', -+ '/usr/share/locale/my/LC_MESSAGES', -+ '/usr/share/locale/nb', -+ '/usr/share/locale/nb/LC_MESSAGES', -+ '/usr/share/locale/nb_NO', -+ '/usr/share/locale/nb_NO/LC_MESSAGES', -+ '/usr/share/locale/nds', -+ '/usr/share/locale/nds/LC_MESSAGES', -+ '/usr/share/locale/ne', -+ '/usr/share/locale/ne/LC_MESSAGES', -+ '/usr/share/locale/nl', -+ '/usr/share/locale/nl/LC_MESSAGES', -+ '/usr/share/locale/nl_BE', -+ '/usr/share/locale/nl_BE/LC_MESSAGES', -+ '/usr/share/locale/nn', -+ '/usr/share/locale/nn/LC_MESSAGES', -+ '/usr/share/locale/nn_NO', -+ '/usr/share/locale/nn_NO/LC_MESSAGES', -+ '/usr/share/locale/nso', -+ '/usr/share/locale/nso/LC_MESSAGES', -+ '/usr/share/locale/oc', -+ '/usr/share/locale/oc/LC_MESSAGES', -+ '/usr/share/locale/om', -+ '/usr/share/locale/om/LC_MESSAGES', -+ '/usr/share/locale/or', -+ '/usr/share/locale/or/LC_MESSAGES', -+ '/usr/share/locale/pa', -+ '/usr/share/locale/pa/LC_MESSAGES', -+ '/usr/share/locale/pl', -+ '/usr/share/locale/pl/LC_MESSAGES', -+ '/usr/share/locale/pl_PL', -+ '/usr/share/locale/pl_PL/LC_MESSAGES', -+ '/usr/share/locale/ps', -+ '/usr/share/locale/ps/LC_MESSAGES', -+ '/usr/share/locale/pt', -+ '/usr/share/locale/pt/LC_MESSAGES', -+ '/usr/share/locale/pt_BR', -+ '/usr/share/locale/pt_BR/LC_MESSAGES', -+ '/usr/share/locale/pt_PT', -+ '/usr/share/locale/pt_PT/LC_MESSAGES', -+ '/usr/share/locale/rm', -+ '/usr/share/locale/rm/LC_MESSAGES', -+ '/usr/share/locale/ro', -+ '/usr/share/locale/ro/LC_MESSAGES', -+ '/usr/share/locale/ru', -+ '/usr/share/locale/ru/LC_MESSAGES', -+ '/usr/share/locale/ru_RU', -+ '/usr/share/locale/ru_RU/LC_MESSAGES', -+ '/usr/share/locale/ru_UA.koi8u', -+ '/usr/share/locale/ru_UA.koi8u/LC_MESSAGES', -+ '/usr/share/locale/rw', -+ '/usr/share/locale/rw/LC_MESSAGES', -+ '/usr/share/locale/sa', -+ '/usr/share/locale/sa/LC_MESSAGES', -+ '/usr/share/locale/se', -+ '/usr/share/locale/se/LC_MESSAGES', -+ '/usr/share/locale/si', -+ '/usr/share/locale/si/LC_MESSAGES', -+ '/usr/share/locale/sid', -+ '/usr/share/locale/sid/LC_MESSAGES', -+ '/usr/share/locale/sk', -+ '/usr/share/locale/sk/LC_MESSAGES', -+ '/usr/share/locale/sl', -+ '/usr/share/locale/sl/LC_MESSAGES', -+ '/usr/share/locale/sl_SI', -+ '/usr/share/locale/sl_SI/LC_MESSAGES', -+ '/usr/share/locale/so', -+ '/usr/share/locale/so/LC_MESSAGES', -+ '/usr/share/locale/sp', -+ '/usr/share/locale/sp/LC_MESSAGES', -+ '/usr/share/locale/sq', -+ '/usr/share/locale/sq/LC_MESSAGES', -+ '/usr/share/locale/sq_AL', -+ '/usr/share/locale/sq_AL/LC_MESSAGES', -+ '/usr/share/locale/sr', -+ '/usr/share/locale/sr/LC_MESSAGES', -+ '/usr/share/locale/sr@Latn', -+ '/usr/share/locale/sr@Latn/LC_MESSAGES', -+ '/usr/share/locale/sr@ije', -+ '/usr/share/locale/sr@ije/LC_MESSAGES', -+ '/usr/share/locale/ss', -+ '/usr/share/locale/ss/LC_MESSAGES', -+ '/usr/share/locale/st', -+ '/usr/share/locale/st/LC_MESSAGES', -+ '/usr/share/locale/sv', -+ '/usr/share/locale/sv/LC_MESSAGES', -+ '/usr/share/locale/sw', -+ '/usr/share/locale/sw/LC_MESSAGES', -+ '/usr/share/locale/syr', -+ '/usr/share/locale/syr/LC_MESSAGES', -+ '/usr/share/locale/ta', -+ '/usr/share/locale/ta/LC_MESSAGES', -+ '/usr/share/locale/te', -+ '/usr/share/locale/te/LC_MESSAGES', -+ '/usr/share/locale/tg', -+ '/usr/share/locale/tg/LC_MESSAGES', -+ '/usr/share/locale/th', -+ '/usr/share/locale/th/LC_MESSAGES', -+ '/usr/share/locale/ti', -+ '/usr/share/locale/ti/LC_MESSAGES', -+ '/usr/share/locale/tig', -+ '/usr/share/locale/tig/LC_MESSAGES', -+ '/usr/share/locale/tk', -+ '/usr/share/locale/tk/LC_MESSAGES', -+ '/usr/share/locale/tl', -+ '/usr/share/locale/tl/LC_MESSAGES', -+ '/usr/share/locale/tr', -+ '/usr/share/locale/tr/LC_MESSAGES', -+ '/usr/share/locale/tt', -+ '/usr/share/locale/tt/LC_MESSAGES', -+ '/usr/share/locale/ug', -+ '/usr/share/locale/ug/LC_MESSAGES', -+ '/usr/share/locale/uk', -+ '/usr/share/locale/uk/LC_MESSAGES', -+ '/usr/share/locale/uk_UA', -+ '/usr/share/locale/uk_UA/LC_MESSAGES', -+ '/usr/share/locale/ur', -+ '/usr/share/locale/ur/LC_MESSAGES', -+ '/usr/share/locale/urd', -+ '/usr/share/locale/urd/LC_MESSAGES', -+ '/usr/share/locale/uz', -+ '/usr/share/locale/uz/LC_MESSAGES', -+ '/usr/share/locale/uz@cyrillic', -+ '/usr/share/locale/uz@cyrillic/LC_MESSAGES', -+ '/usr/share/locale/ve', -+ '/usr/share/locale/ve/LC_MESSAGES', -+ '/usr/share/locale/ven', -+ '/usr/share/locale/ven/LC_MESSAGES', -+ '/usr/share/locale/vi', -+ '/usr/share/locale/vi/LC_MESSAGES', -+ '/usr/share/locale/wa', -+ '/usr/share/locale/wa/LC_MESSAGES', -+ '/usr/share/locale/wal', -+ '/usr/share/locale/wal/LC_MESSAGES', -+ '/usr/share/locale/wo', -+ '/usr/share/locale/wo/LC_MESSAGES', -+ '/usr/share/locale/xh', -+ '/usr/share/locale/xh/LC_MESSAGES', -+ '/usr/share/locale/yi', -+ '/usr/share/locale/yi/LC_MESSAGES', -+ '/usr/share/locale/yo', -+ '/usr/share/locale/yo/LC_MESSAGES', -+ '/usr/share/locale/zh', -+ '/usr/share/locale/zh/LC_MESSAGES', -+ '/usr/share/locale/zh_CN', -+ '/usr/share/locale/zh_CN.GB2312', -+ '/usr/share/locale/zh_CN.GB2312/LC_MESSAGES', -+ '/usr/share/locale/zh_CN/LC_MESSAGES', -+ '/usr/share/locale/zh_HK', -+ '/usr/share/locale/zh_HK/LC_MESSAGES', -+ '/usr/share/locale/zh_TW', -+ '/usr/share/locale/zh_TW.Big5', -+ '/usr/share/locale/zh_TW.Big5/LC_MESSAGES', -+ '/usr/share/locale/zh_TW/LC_MESSAGES', -+ '/usr/share/locale/zu', -+ '/usr/share/locale/zu/LC_MESSAGES', - '/usr/share/man', - '/usr/share/man/man1', - '/usr/share/man/man2', -@@ -131,25 +522,54 @@ STANDARD_DIRS = ( - '/usr/share/man/man8', - '/usr/share/man/man9', - '/usr/share/man/mann', -+ '/usr/share/mime', -+ '/usr/share/mime/packages', - '/usr/share/misc', -+ '/usr/share/nls', -+ '/usr/share/pixmaps', -+ '/usr/share/pkgconfig', -+ '/usr/share/sgml', -+ '/usr/share/sgml/docbook', -+ '/usr/share/sounds', -+ '/usr/share/themes', -+ '/usr/share/tmac', -+ '/usr/share/xml', -+ '/usr/share/xml/docbook', -+ '/usr/share/xsessions', - '/usr/src', -+ '/usr/src/packages', - '/usr/tmp', - '/var', -+ '/var/X11R6', -+ '/var/adm', -+ '/var/adm/backup', -+ '/var/adm/backup/rpmdb', -+ '/var/adm/backup/sysconfig', -+ '/var/adm/fillup-templates', -+ '/var/adm/perl-modules', - '/var/cache', -- '/var/db', -+ '/var/cache/fonts', -+ '/var/cache/man', -+ '/var/games', - '/var/lib', -- '/var/lib/games', -+ '/var/lib/empty', - '/var/lib/misc', -- '/var/lib/rpm', -- '/var/local', -+ '/var/lib/news', -+ '/var/lib/nobody', -+ '/var/lib/pam_devperm', -+ '/var/lib/wwwrun', - '/var/log', - '/var/mail', -- '/var/nis', - '/var/opt', -- '/var/preserve', - '/var/spool', -+ '/var/spool/clientmqueue', -+ '/var/spool/locks', -+ '/var/spool/lpd', - '/var/spool/mail', -+ '/var/spool/uucp', -+ '/var/spool/uucp/uucp', - '/var/tmp', -+ '/var/tmp/vi.recover', - ) - - DEFAULT_GAMES_GROUPS = 'Games' diff --git a/suse-filter-exception.diff b/suse-filter-exception.diff index 29fc3be..bdea96f 100644 --- a/suse-filter-exception.diff +++ b/suse-filter-exception.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-filter-exception.diff Config.py | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 54 insertions(+), 7 deletions(-) -diff --git a/Config.py b/Config.py -index f27607c..b4e19cc 100644 ---- a/Config.py -+++ b/Config.py -@@ -111,12 +111,23 @@ def getOption(name, default=""): +Index: rpmlint-rpmlint-1.10/Config.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/Config.py ++++ rpmlint-rpmlint-1.10/Config.py +@@ -114,12 +114,23 @@ def getOption(name, default=""): _filters = [] _filters_re = None @@ -37,7 +37,7 @@ index f27607c..b4e19cc 100644 def removeFilter(s): -@@ -133,8 +144,13 @@ _scoring = {} +@@ -137,8 +148,13 @@ _scoring = {} def setBadness(s, score): @@ -51,7 +51,7 @@ index f27607c..b4e19cc 100644 def badness(s): return _scoring.get(s, 0) -@@ -144,11 +160,24 @@ _non_named_group_re = re.compile('[^\\](\()[^:]') +@@ -149,11 +165,24 @@ _non_named_group_re = re.compile(r'[^\\] def isFiltered(s): global _filters_re @@ -80,7 +80,7 @@ index f27607c..b4e19cc 100644 _filters_re = '(?:' + _filters[0] + ')' for idx in range(1, len(_filters)): -@@ -160,9 +189,27 @@ def isFiltered(s): +@@ -165,9 +194,27 @@ def isFiltered(s): _filters_re = _filters_re + '|(?:' + _filters[idx] + ')' _filters_re = re.compile(_filters_re) diff --git a/suse-filter-more-verbose.diff b/suse-filter-more-verbose.diff index 31019dd..1773195 100644 --- a/suse-filter-more-verbose.diff +++ b/suse-filter-more-verbose.diff @@ -7,10 +7,10 @@ Subject: [PATCH] suse-filter-more-verbose.diff Config.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) -diff --git a/Config.py b/Config.py -index b4e19cc..c29db24 100644 ---- a/Config.py -+++ b/Config.py +Index: rpmlint-rpmlint-1.10/Config.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/Config.py ++++ rpmlint-rpmlint-1.10/Config.py @@ -10,6 +10,7 @@ import locale import os.path @@ -19,7 +19,7 @@ index b4e19cc..c29db24 100644 try: from __version__ import __version__ -@@ -175,7 +176,17 @@ def isFiltered(s): +@@ -180,7 +181,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 b4e19cc..c29db24 100644 if _filters_re == None and len(_filters): _filters_re = '(?:' + _filters[0] + ')' -@@ -187,7 +198,17 @@ def isFiltered(s): +@@ -192,7 +203,17 @@ def isFiltered(s): if '(' in _filters[idx]: _non_named_group_re.subn('(:?', _filters[idx]) _filters_re = _filters_re + '|(?:' + _filters[idx] + ')' diff --git a/suse-g-ir-chech.diff b/suse-g-ir-chech.diff deleted file mode 100644 index 9909296..0000000 --- a/suse-g-ir-chech.diff +++ /dev/null @@ -1,22 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:40 +0200 -Subject: [PATCH] suse-g-ir-chech.diff - -=================================================================== ---- - FilesCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/FilesCheck.py b/FilesCheck.py -index 6c322c6..24029f1 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -607,7 +607,7 @@ points_regex = re.compile('^\.\./(.*)') - doc_regex = re.compile('^/usr(/share|/X11R6)?/(doc|man|info)/|^/opt/kde3/share/doc|^/usr/share/gnome/help') - bin_regex = re.compile('^/(?:usr/(?:s?bin|games)|s?bin)/(.*)') - includefile_regex = re.compile('\.(c|h)(pp|xx)?$', re.IGNORECASE) --develfile_regex = re.compile('\.(a|cmxa?|mli?)$') -+develfile_regex = re.compile('\.(a|cmxa?|mli?|gir)$') - buildconfigfile_regex = re.compile('(\.pc|/bin/.+-config)$') - docdir_examples_regex = re.compile('^/usr/(?:share/doc/packages|lib(?:64))/[^/]+/(?:example|demo|script|contrib)') - # room for improvement with catching more -R, but also for false positives... diff --git a/suse-ignore-specfile-errors.diff b/suse-ignore-specfile-errors.diff index 7974ae5..80d7c86 100644 --- a/suse-ignore-specfile-errors.diff +++ b/suse-ignore-specfile-errors.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-ignore-specfile-errors.diff SpecCheck.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -diff --git a/SpecCheck.py b/SpecCheck.py -index 4dafdb9..5149dc3 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -563,9 +563,8 @@ class SpecCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/SpecCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/SpecCheck.py ++++ rpmlint-rpmlint-1.10/SpecCheck.py +@@ -559,9 +559,8 @@ class SpecCheck(AbstractCheck.AbstractCh printWarning(pkg, "patch-not-applied", "Patch%d:" % pnum, pfile) diff --git a/suse-manpages-for-rc-scripts.diff b/suse-manpages-for-rc-scripts.diff index 25e0518..958201e 100644 --- a/suse-manpages-for-rc-scripts.diff +++ b/suse-manpages-for-rc-scripts.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-manpages-for-rc-scripts FilesCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 806b886..81c5680 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -1429,7 +1429,7 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -1031,7 +1031,7 @@ class FilesCheck(AbstractCheck.AbstractC for exe, paths in bindir_exes.items(): if len(paths) > 1: printWarning(pkg, "duplicate-executable", exe, paths) @@ -19,4 +19,4 @@ index 806b886..81c5680 100644 + if exe not in man_basenames and not exe.startswith("rc") and len(paths) is not 0: printWarning(pkg, "no-manual-page-for-binary", exe) - # Create an object to enable the auto registration of the test + diff --git a/suse-no-run-ldconfig.diff b/suse-no-run-ldconfig.diff index 397fb36..ba29a36 100644 --- a/suse-no-run-ldconfig.diff +++ b/suse-no-run-ldconfig.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-no-run-ldconfig.diff SpecCheck.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) -diff --git a/SpecCheck.py b/SpecCheck.py -index 8fc6e94..0d77a03 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -449,6 +449,10 @@ class SpecCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/SpecCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/SpecCheck.py ++++ rpmlint-rpmlint-1.10/SpecCheck.py +@@ -454,6 +454,10 @@ class SpecCheck(AbstractCheck.AbstractCh 'comparison-operator-in-deptoken', conf) @@ -22,7 +22,7 @@ index 8fc6e94..0d77a03 100644 if current_section == 'changelog': for match in AbstractCheck.macro_regex.findall(line): res = re.match('%+', match) -@@ -774,6 +778,14 @@ may break short circuit builds.''', +@@ -771,6 +775,14 @@ may break short circuit builds.''', '''Make check or other automated regression test should be run in %check, as they can be disabled with a rpm macro for short circuiting purposes.''', diff --git a/suse-pkg-config-check.diff b/suse-pkg-config-check.diff index 8467d1f..c0665e3 100644 --- a/suse-pkg-config-check.diff +++ b/suse-pkg-config-check.diff @@ -7,19 +7,19 @@ Subject: [PATCH] suse-pkg-config-check.diff TagsCheck.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) -diff --git a/TagsCheck.py b/TagsCheck.py -index 01ef3ee..e161aec 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -416,6 +416,7 @@ lib_devel_number_regex = re.compile('^lib(.*?)([0-9.]+)(_[0-9.]+)?-devel') +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- 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 invalid_url_regex = re.compile(Config.getOption('InvalidURL'), re.IGNORECASE) - lib_package_regex = re.compile('(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE) - leading_space_regex = re.compile('^\s+') + lib_package_regex = re.compile(r'(?:^(?:compat-)?lib.*?(\.so.*)?|libs?[\d-]*)$', re.IGNORECASE) + leading_space_regex = re.compile(r'^\s+') +pkg_config_regex = re.compile('^/usr/(?:lib\d*|share)/pkgconfig/') - license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s') - invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) + 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 -@@ -634,10 +635,12 @@ class TagsCheck(AbstractCheck.AbstractCheck): +@@ -635,10 +636,12 @@ class TagsCheck(AbstractCheck.AbstractCh base = is_devel.group(1) dep = None has_so = False @@ -33,7 +33,7 @@ index 01ef3ee..e161aec 100644 if has_so: base_or_libs = base + '/' + base + '-libs/lib' + base # try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)") -@@ -674,6 +677,15 @@ class TagsCheck(AbstractCheck.AbstractCheck): +@@ -675,6 +678,15 @@ class TagsCheck(AbstractCheck.AbstractCh if prov not in (x[0] for x in pkg.provides()): printWarning(pkg, 'no-provides', prov) @@ -49,7 +49,7 @@ index 01ef3ee..e161aec 100644 # List of words to ignore in spell check ignored_words = set() for pf in pkg.files(): -@@ -1107,6 +1119,11 @@ once.''', +@@ -1108,6 +1120,11 @@ once.''', 'no-url-tag', '''The URL tag is missing. Please add a http or ftp link to the project location.''', diff --git a/suse-python3-naming-policy.diff b/suse-python3-naming-policy.diff index 9cc8c27..1255c53 100644 --- a/suse-python3-naming-policy.diff +++ b/suse-python3-naming-policy.diff @@ -7,12 +7,12 @@ Subject: [PATCH] suse-python3-naming-policy.diff NamingPolicyCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/NamingPolicyCheck.py b/NamingPolicyCheck.py -index 231b936..96fb91d 100644 ---- a/NamingPolicyCheck.py -+++ b/NamingPolicyCheck.py -@@ -90,7 +90,7 @@ check = NamingPolicyCheck() - +Index: rpmlint-rpmlint-1.10/NamingPolicyCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/NamingPolicyCheck.py ++++ rpmlint-rpmlint-1.10/NamingPolicyCheck.py +@@ -89,7 +89,7 @@ check = NamingPolicyCheck() + # if somone as a elegant solution, I will be happy to implement and test it. check.add_check('xmms', '^xmms(-|$)', '^/usr/lib(64)?/xmms/') -check.add_check('python', '^python(-|$)', '^/usr/lib(64)?/python[1-9](-[1-9])?') diff --git a/suse-readd_terminator_in_regex.patch b/suse-readd_terminator_in_regex.patch deleted file mode 100644 index 9c61813..0000000 --- a/suse-readd_terminator_in_regex.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 0d93fa7656cb68c63c11d451d7894cac17af33e2 Mon Sep 17 00:00:00 2001 -From: StefanBruens -Date: Mon, 12 Dec 2016 20:12:46 +0100 -Subject: [PATCH] Readd dropped '$' in regex, fix broken check on devel - dependency - -The current regex also maches "Requires: libzork-data", although it should only match e.g. "libzork1" or "zork-libs". As the latter sorts after "libzork-data", an existing correct dependency may be missed. ---- - TagsCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/TagsCheck.py b/TagsCheck.py -index fa6154c..e71d90b 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -640,7 +640,7 @@ def check(self, pkg): - base_or_libs = base + '*/' + base + '-libs/lib' + base + '*' - # try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)") - base_or_libs_re = re.compile( -- '^(lib)?%s(-libs)?[\d_]*(\(\w+-\d+\))?' % re.escape(base)) -+ '^(lib)?%s(-libs)?[\d_]*(\(\w+-\d+\))?$' % re.escape(base)) - for d in deps: - if base_or_libs_re.match(d[0]): - dep = d diff --git a/suse-shlib-devel-dependency.diff b/suse-shlib-devel-dependency.diff index 09c7b95..ed75edc 100644 --- a/suse-shlib-devel-dependency.diff +++ b/suse-shlib-devel-dependency.diff @@ -7,20 +7,20 @@ Subject: [PATCH] suse-shlib-devel-dependency.diff TagsCheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/TagsCheck.py b/TagsCheck.py -index 8dccbf1..f229a28 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -642,10 +642,10 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -673,10 +673,10 @@ class TagsCheck(AbstractCheck.AbstractCh if pkg_config_regex.match(fname) and fname.endswith('.pc'): has_pc = True if has_so: - base_or_libs = base + '/' + base + '-libs/lib' + base -+ base_or_libs = base + '*/' + base + '-libs/lib' + base + '*' ++ base_or_libs = base + '/' + base + '-libs/lib' + base + '*' # try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)") base_or_libs_re = re.compile( -- '^(lib)?%s(-libs)?(\(\w+-\d+\))?$' % re.escape(base)) -+ '^(lib)?%s(-libs)?[\d_]*(\(\w+-\d+\))?' % re.escape(base)) +- r'^(lib)?%s(-libs)?(\(\w+-\d+\))?$' % re.escape(base)) ++ r'^(lib)?%s(-libs)?[\d_]*(\(\w+-\d+\))?$' % re.escape(base)) for d in deps: if base_or_libs_re.match(d[0]): dep = d diff --git a/suse-spdx-license-exceptions.patch b/suse-spdx-license-exceptions.patch index 3a9b86e..bd3b6ee 100644 --- a/suse-spdx-license-exceptions.patch +++ b/suse-spdx-license-exceptions.patch @@ -7,13 +7,13 @@ Subject: [PATCH] Handle SPDX style license exceptions TagsCheck.py | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) -Index: rpmlint-rpmlint-1.8/TagsCheck.py +Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== ---- rpmlint-rpmlint-1.8.orig/TagsCheck.py -+++ rpmlint-rpmlint-1.8/TagsCheck.py +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py @@ -139,6 +139,34 @@ DEFAULT_VALID_LICENSES = ( 'Shareware', - ) + ) +DEFAULT_VALID_LICENSE_EXCEPTIONS = ( + '389-exception', @@ -53,16 +53,16 @@ Index: rpmlint-rpmlint-1.8/TagsCheck.py +VALID_LICENSE_EXCEPTIONS = Config.getOption('ValidLicenseExceptions', DEFAULT_VALID_LICENSE_EXCEPTIONS) INVALID_REQUIRES = map(re.compile, Config.getOption('InvalidRequires', DEFAULT_INVALID_REQUIRES)) packager_regex = re.compile(Config.getOption('Packager')) - changelog_version_regex = re.compile('[^>]([^ >]+)\s*$') -@@ -418,6 +447,7 @@ lib_package_regex = re.compile('(?:^(?:c - leading_space_regex = re.compile('^\s+') + changelog_version_regex = re.compile(r'[^>]([^ >]+)\s*$') +@@ -418,6 +447,7 @@ lib_package_regex = re.compile(r'(?:^(?: + leading_space_regex = re.compile(r'^\s+') pkg_config_regex = re.compile('^/usr/(?:lib\d*|share)/pkgconfig/') - license_regex = re.compile('\(([^)]+)\)|\s(?:and|or)\s') + license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s') +license_exception_regex = re.compile('(\S+)\sWITH\s(\S+)') - invalid_version_regex = re.compile('([0-9](?:rc|alpha|beta|pre).*)', re.IGNORECASE) + 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('(' + Config.getOption('ForbiddenWords') + ')', re.IGNORECASE) -@@ -787,6 +817,10 @@ class TagsCheck(AbstractCheck.AbstractCh + forbidden_words_regex = re.compile(r'(%s)' % Config.getOption('ForbiddenWords'), re.IGNORECASE) +@@ -788,6 +818,10 @@ class TagsCheck(AbstractCheck.AbstractCh # printWarning(pkg, 'package-provides-itself') # break @@ -73,7 +73,7 @@ Index: rpmlint-rpmlint-1.8/TagsCheck.py def split_license(license): return (x.strip() for x in (l for l in license_regex.split(license) if l)) -@@ -797,7 +831,17 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -798,7 +832,17 @@ class TagsCheck(AbstractCheck.AbstractCh else: valid_license = True if rpm_license not in VALID_LICENSES: @@ -92,7 +92,7 @@ Index: rpmlint-rpmlint-1.8/TagsCheck.py if l1 in VALID_LICENSES: continue for l2 in split_license(l1): -@@ -1073,6 +1117,11 @@ your specfile.''', +@@ -1074,6 +1118,11 @@ your specfile.''', '''The value of the License tag was not recognized. Known values are: "%s".''' % '", "'.join(VALID_LICENSES), diff --git a/suse-sysv-init-checks.diff b/suse-sysv-init-checks.diff deleted file mode 100644 index 07a9cf2..0000000 --- a/suse-sysv-init-checks.diff +++ /dev/null @@ -1,82 +0,0 @@ -From: Ludwig Nussel -Date: Fri, 10 Apr 2015 14:38:22 +0200 -Subject: [PATCH] suse sysv init checks - -we don't use chkconfig but have different macros ---- - InitScriptCheck.py | 48 ++++++++++++++++++++++++++++++++++-------------- - 1 file changed, 34 insertions(+), 14 deletions(-) - -diff --git a/InitScriptCheck.py b/InitScriptCheck.py -index f9b13a1..f81a450 100644 ---- a/InitScriptCheck.py -+++ b/InitScriptCheck.py -@@ -36,6 +36,10 @@ LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', 'Should-Start', - RECOMMENDED_LSB_KEYWORDS = ('Provides', 'Required-Start', 'Required-Stop', - 'Default-Stop', 'Short-Description') - -+suse = True -+stop_on_removal_regex=re.compile('bin/systemctl stop (?!.+\.service).+') -+restart_on_update_regex=re.compile('bin/systemctl try-restart (?!.+\.service).+') -+insserv_cleanup_regex=re.compile('^\s*/sbin/insserv /etc/init.d$', re.MULTILINE) - - class InitScriptCheck(AbstractCheck.AbstractCheck): - -@@ -44,6 +48,12 @@ class InitScriptCheck(AbstractCheck.AbstractCheck): - - def check_binary(self, pkg): - initscript_list = [] -+ -+ # check chkconfig call in %post and %preun -+ postin = pkg[rpm.RPMTAG_POSTIN] or pkg.scriptprog(rpm.RPMTAG_POSTINPROG) -+ preun = pkg[rpm.RPMTAG_PREUN] or pkg.scriptprog(rpm.RPMTAG_PREUNPROG) -+ postun = pkg[rpm.RPMTAG_POSTUN] or pkg.scriptprog(rpm.RPMTAG_POSTUNPROG) -+ - for fname, pkgfile in pkg.files().items(): - - if not fname.startswith('/etc/init.d/') and \ -@@ -61,20 +71,30 @@ class InitScriptCheck(AbstractCheck.AbstractCheck): - if "." in basename: - printError(pkg, 'init-script-name-with-dot', fname) - -- # check chkconfig call in %post and %preun -- postin = pkg[rpm.RPMTAG_POSTIN] or \ -- pkg.scriptprog(rpm.RPMTAG_POSTINPROG) -- if not postin: -- printError(pkg, 'init-script-without-chkconfig-postin', fname) -- elif not chkconfig_regex.search(postin): -- printError(pkg, 'postin-without-chkconfig', fname) -- -- preun = pkg[rpm.RPMTAG_PREUN] or \ -- pkg.scriptprog(rpm.RPMTAG_PREUNPROG) -- if not preun: -- printError(pkg, 'init-script-without-chkconfig-preun', fname) -- elif not chkconfig_regex.search(preun): -- printError(pkg, 'preun-without-chkconfig', fname) -+ if not suse: -+ # check chkconfig call in %post and %preun -+ postin = pkg[rpm.RPMTAG_POSTIN] or \ -+ pkg.scriptprog(rpm.RPMTAG_POSTINPROG) -+ if not postin: -+ printError(pkg, 'init-script-without-chkconfig-postin', fname) -+ elif not chkconfig_regex.search(postin): -+ printError(pkg, 'postin-without-chkconfig', fname) -+ -+ preun = pkg[rpm.RPMTAG_PREUN] or \ -+ pkg.scriptprog(rpm.RPMTAG_PREUNPROG) -+ if not preun: -+ printError(pkg, 'init-script-without-chkconfig-preun', fname) -+ elif not chkconfig_regex.search(preun): -+ printError(pkg, 'preun-without-chkconfig', fname) -+ else: -+ if not preun or not stop_on_removal_regex.search(preun): -+ printError(pkg, 'init-script-without-%stop_on_removal-preun', fname) -+ -+ if not postun or not restart_on_update_regex.search(postun): -+ printError(pkg, 'init-script-without-%restart_on_update-postun', fname) -+ -+ if not postun or not insserv_cleanup_regex.search(postun): -+ printError(pkg, 'init-script-without-%insserv_cleanup-postun', fname) - - status_found = False - reload_found = False diff --git a/suse-tests-without-badness.patch b/suse-tests-without-badness.patch new file mode 100644 index 0000000..6d8a801 --- /dev/null +++ b/suse-tests-without-badness.patch @@ -0,0 +1,47 @@ +Index: rpmlint-rpmlint-1.10/test.sh +=================================================================== +--- rpmlint-rpmlint-1.10.orig/test.sh ++++ rpmlint-rpmlint-1.10/test.sh +@@ -19,7 +19,13 @@ for i in $TESTPATH/test.*.py; do + fi + done + +-run_rpmlint="$PYTHON ./rpmlint -C $(pwd)" ++export RPMLINT_SKIP_GLOBAL=1 ++ ++run_rpmlint="$PYTHON ./rpmlint -f config -C $(pwd)" ++ ++echo "Removing Badness.." ++cp config config.backup ++sed -e "s,setOption(\"Badnes.*,," config + + echo "Check that rpmlint executes with no unexpected errors" + echo "...in default locale" +@@ -40,10 +46,6 @@ $PYTEST -v || exit $? + + unset PYTHONWARNINGS + +-echo "$FLAKE8 tests" +-$FLAKE8 --version +-$FLAKE8 . ./rpmdiff ./rpmlint || exit $? +- + echo "man page tests" + if man --help 2>&1 | grep -q -- --warnings; then + tmpfile=$(mktemp) || exit 1 +Index: rpmlint-rpmlint-1.10/rpmlint +=================================================================== +--- rpmlint-rpmlint-1.10.orig/rpmlint ++++ rpmlint-rpmlint-1.10/rpmlint +@@ -269,8 +269,10 @@ if not os.path.exists(os.path.expanduser + info_error = set() + + # load global config files +-configs = glob.glob('/etc/rpmlint/*config') +-configs.sort() ++configs = [] ++if 'RPMLINT_SKIP_GLOBAL' not in os.environ: ++ configs = glob.glob('/etc/rpmlint/*config') ++ configs.sort() + + # Was rpmlint invoked as a prefixed variant? + m = re.match(r"(?P[\w-]+)-rpmlint(\.py)?", argv0) diff --git a/suse-url-check.diff b/suse-url-check.diff index 2effeb6..6f98307 100644 --- a/suse-url-check.diff +++ b/suse-url-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-url-check.diff TagsCheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/TagsCheck.py b/TagsCheck.py -index cdb8eb4..01ef3ee 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -795,7 +795,7 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.9/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.9.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.9/TagsCheck.py +@@ -796,7 +796,7 @@ class TagsCheck(AbstractCheck.AbstractCh if not valid_license: self._unexpanded_macros(pkg, 'License', rpm_license) @@ -20,7 +20,7 @@ index cdb8eb4..01ef3ee 100644 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) -@@ -1105,7 +1105,7 @@ once.''', +@@ -1106,7 +1106,7 @@ once.''', '''This rpm requires a specific release of another package.''', 'no-url-tag', diff --git a/suse-version.diff b/suse-version.diff index a4adc2a..09da413 100644 --- a/suse-version.diff +++ b/suse-version.diff @@ -7,19 +7,19 @@ Subject: [PATCH] suse-version.diff SpecCheck.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -diff --git a/SpecCheck.py b/SpecCheck.py -index b69bead..2e3ba56 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -67,6 +67,7 @@ libdir_regex = re.compile('%{?_lib(?:dir)?\}?\\b') - comment_or_empty_regex = re.compile('^\s*(#|$)') - defattr_regex = re.compile('^\s*%defattr\\b') - attr_regex = re.compile('^\s*%attr\\b') +Index: rpmlint-rpmlint-1.10/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 + buildarch_regex = re_tag_compile('BuildArch(?:itectures)?') + buildprereq_regex = re_tag_compile('BuildPreReq') + prereq_regex = re_tag_compile(r'PreReq(\(.*\))') +suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)') - section_regexs = dict( - ([x, re.compile('^%' + x + '(?:\s|$)')] - for x in ('build', 'changelog', 'check', 'clean', 'description', 'files', -@@ -388,6 +389,12 @@ class SpecCheck(AbstractCheck.AbstractCheck): + + 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 if not res.group(1).startswith('%'): printWarning(pkg, 'hardcoded-prefix-tag', res.group(1)) @@ -32,9 +32,9 @@ index b69bead..2e3ba56 100644 res = prereq_regex.search(line) if res: printError(pkg, 'prereq-use', res.group(2)) -@@ -816,6 +823,15 @@ in the resulting binary package depending on the build environment and rpmbuild - version (typically < 4.4). Add default attributes using %defattr before it in - the %files section, or use per entry %attr's.''', +@@ -806,6 +813,15 @@ architecture independent or if some othe + in some editors but can lead to obscure errors. It should be replaced by a + regular space.''', +'obsolete-suse-version-check', +'''The specfile contains a comparison of %suse_version against a suse release diff --git a/update_git.sh b/update_git.sh deleted file mode 100644 index 066d6cc..0000000 --- a/update_git.sh +++ /dev/null @@ -1,151 +0,0 @@ -#!/bin/bash -e -# -# based on qemu's update_git.sh this program updates the patches -# applied on top of a tarball based on commmits in git -# -# how to use: -# quilt setup rpmlint.spec -# cp rpmlint-$RPMLINTVERSION/series . -# mkdir ~/git; cd ~/git -# git clone git://git.code.sf.net/p/rpmlint/code rpmlint-code -# git checkout -b opensuse-$RPMLINTVERSION v$RPMLINTVERSION -# git quiltimport --patches /where/rpmlint/checkout/is -# ... add/remove/rebase patches -# ... to rebase to a new version create branch and modify versions below -# when done run update_git.sh - -GIT_TREE=https://github.com/lnussel/rpmlint-code.git -GIT_LOCAL_TREE=~/git/rpmlint-code -GIT_BRANCH=opensuse-1.8 -GIT_UPSTREAM_TAG=rpmlint-1.8 - -cleanup() -{ - [ -z "$GIT_DIR" ] || rm -rf "$GIT_DIR" - [ -z "$CMP_DIR" ] || rm -rf "$GIT_DIR" -} - -trap cleanup EXIT - -GIT_DIR=`mktemp -d --tmpdir update_git.XXXXXXXXXX` -CMP_DIR=`mktemp -d --tmpdir update_git.XXXXXXXXXX` - -rm -f .update_git.* - -if [ -d "$GIT_LOCAL_TREE" ]; then - echo "Processing $GIT_BRANCH branch of local git tree, using tag:" \ - "$GIT_UPSTREAM_TAG" - if ! (cd $GIT_LOCAL_TREE && git show-branch $GIT_BRANCH &>/dev/null); then - echo "Error: Branch $GIT_BRANCH not found - please create a remote" \ - "tracking branch of origin/$GIT_BRANCH" - exit - fi - git clone -ls $GIT_LOCAL_TREE $GIT_DIR -b $GIT_BRANCH - if ! (cd $GIT_LOCAL_TREE && git remote show upstream &>/dev/null); then - echo "Remote for upstream git tree not found. Next time add remote" \ - "named upstream for $GIT_TREE and update" - (cd $GIT_DIR && git remote add upstream "$GIT_TREE") - (cd $GIT_DIR && git remote update) - fi -else - echo "Processing $GIT_BRANCH branch of remote git tree, using tag:" \ - "$GIT_UPSTREAM_TAG" - echo "(For much fast processing, consider establishing a local git tree" \ - "at $GIT_LOCAL_TREE)" - git clone $GIT_TREE $GIT_DIR -b $GIT_BRANCH - (cd $GIT_DIR && git remote add upstream "$GIT_TREE") - (cd $GIT_DIR && git remote update) -fi -(cd $GIT_DIR && git format-patch -N $GIT_UPSTREAM_TAG --suffix=.tmp -o $CMP_DIR >/dev/null) - -CHANGED_COUNT=0 -UNCHANGED_COUNT=0 -DELETED_COUNT=0 -ADDED_COUNT=0 - -shopt -s nullglob - -patches=() -for i in $CMP_DIR/*.tmp; do - basename="${i##*/}" - newname=${basename%.tmp} - newname=${newname%.diff} # remove .diff suffix it exist - # limit file names to 40 chars before extension - newname=${newname:0:40}.diff - # remove git signature and commit hash to make content - # independent of git version - head -n -3 "$i" | tail -n +2 > "$CMP_DIR/$newname" - rm "$i" - localname=${newname#*-} - patches+=("$localname") - if [ -e "$localname" ]; then - if cmp -s "$CMP_DIR/$newname" "$localname"; then - rm "$CMP_DIR/$newname" - let UNCHANGED_COUNT+=1 - else - mv "$CMP_DIR/$newname" "$localname" - let CHANGED_COUNT+=1 - fi - else - mv "$CMP_DIR/$newname" "$localname" - let ADDED_COUNT+=1 - echo " $localname" >> .update_git.changes.added - osc add "$localname" - fi -done - -# delete dropped patches -for patch in *.diff; do - keep= - for i in "${patches[@]}"; do - if [ "$i" = "$patch" ]; then - keep=1 - break - fi - done - if [ -z "$keep" ]; then - osc rm --force $patch - let DELETED_COUNT+=1 - echo " $patch" >> .update_git.changes.deleted - fi -done - -for package in rpmlint; do - skip= - while IFS= read -r line; do - if [ "$line" = "# PATCHLIST END" ]; then - skip= - i=0 - for patch in "${patches[@]}"; do - printf "Patch%02d: %s\n" "$i" "$patch" - let i+=1 - done - fi - if [ -z "$skip" ]; then - echo "$line" - fi - if [ "$line" = "# PATCHLIST BEGIN" ]; then - skip=1 - fi - done < $package.spec > $package.spec.new - mv $package.spec.new $package.spec - - if [ -e .update_git.changes.deleted ]; then - echo "* Patches dropped:" >> $package.changes.proposed - cat .update_git.changes.deleted >> $package.changes.proposed - fi - if [ -e .update_git.changes.added ]; then - echo "* Patches added:" >> $package.changes.proposed - cat .update_git.changes.added >> $package.changes.proposed - fi - if [ -e $package.changes.proposed ]; then - osc vc --file=$package.changes.proposed $package - rm -f $package.changes.proposed - fi -done -rm -f .update_git.* -echo "git patch summary" -echo " unchanged: $UNCHANGED_COUNT" -echo " changed: $CHANGED_COUNT" -echo " deleted: $DELETED_COUNT" -echo " added: $ADDED_COUNT" diff --git a/usr-arch.diff b/usr-arch.diff index 2ebc2c4..fe52b03 100644 --- a/usr-arch.diff +++ b/usr-arch.diff @@ -7,19 +7,19 @@ Subject: [PATCH] usr-arch.diff BinariesCheck.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -diff --git a/BinariesCheck.py b/BinariesCheck.py -index 2e5758e..c7fadab 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -313,6 +313,7 @@ usr_lib_exception_regex = re.compile(Config.getOption('UsrLibBinaryException', ' - srcname_regex = re.compile('(.*?)-[0-9]') - invalid_dir_ref_regex = re.compile('/(home|tmp)(\W|$)') - ocaml_mixed_regex = re.compile('^Caml1999X0\d\d$') +Index: rpmlint-rpmlint-1.10/BinariesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/BinariesCheck.py ++++ rpmlint-rpmlint-1.10/BinariesCheck.py +@@ -324,6 +324,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('/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64|m68k|arm|aarch64)') def dir_base(path): -@@ -386,7 +387,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +@@ -397,7 +398,7 @@ class BinariesCheck(AbstractCheck.Abstra # arch dependent packages only from here on # in /usr/share ? diff --git a/version-control-internal-file.diff b/version-control-internal-file.diff deleted file mode 100644 index b53ab8f..0000000 --- a/version-control-internal-file.diff +++ /dev/null @@ -1,22 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:39 +0200 -Subject: [PATCH] version-control-internal-file.diff - -also detect RCS files ---- - FilesCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/FilesCheck.py b/FilesCheck.py -index aa1fa25..59901e7 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -620,7 +620,7 @@ ldconfig_regex = re.compile('^[^#]*ldconfig', re.MULTILINE) - depmod_regex = re.compile('^[^#]*depmod', re.MULTILINE) - install_info_regex = re.compile('^[^#]*install-info', re.MULTILINE) - perl_temp_file_regex = re.compile('.*perl.*/(\.packlist|perllocal\.pod)$') --scm_regex = re.compile('/CVS/[^/]+$|/\.(bzr|cvs|git|hg)ignore$|/\.hgtags$|/\.(bzr|git|hg|svn)/|/(\.arch-ids|{arch})/') -+scm_regex=re.compile('/(CVS|RCS)(/[^/]+)?$|/\.(bzr|cvs|git|hg)ignore$|/\.hgtags$|/\.(bzr|git|hg|svn)/|/(\.arch-ids|{arch})/|,v$') - games_path_regex = re.compile('^/usr(/lib(64)?)?/games/') - games_group_regex = re.compile(Config.getOption('RpmGamesGroups', DEFAULT_GAMES_GROUPS)) - dangling_exceptions = Config.getOption('DanglingSymlinkExceptions', DEFAULT_DANGLING_EXCEPTIONS) diff --git a/xdg-paths-update.diff b/xdg-paths-update.diff index 09005d2..7886f3a 100644 --- a/xdg-paths-update.diff +++ b/xdg-paths-update.diff @@ -7,16 +7,16 @@ Subject: [PATCH] xdg-paths-update.diff MenuXDGCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/MenuXDGCheck.py b/MenuXDGCheck.py -index 4aab385..158db23 100644 ---- a/MenuXDGCheck.py -+++ b/MenuXDGCheck.py -@@ -24,7 +24,7 @@ class MenuXDGCheck(AbstractCheck.AbstractFilesCheck): +Index: rpmlint-rpmlint-1.10/MenuXDGCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/MenuXDGCheck.py ++++ rpmlint-rpmlint-1.10/MenuXDGCheck.py +@@ -25,7 +25,7 @@ class MenuXDGCheck(AbstractCheck.Abstrac # $ echo $XDG_DATA_DIRS/applications # /var/lib/menu-xdg:/usr/share AbstractCheck.AbstractFilesCheck.__init__( -- self, "MenuXDGCheck", "/usr/share/applications/.*\.desktop$") -+ self, "MenuXDGCheck", "(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$") +- self, "MenuXDGCheck", r"/usr/share/applications/.*\.desktop$") ++ self, "MenuXDGCheck", r"(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$") def check_file(self, pkg, filename): root = pkg.dirName() diff --git a/yast-provides.diff b/yast-provides.diff index 91cfb71..fe2131b 100644 --- a/yast-provides.diff +++ b/yast-provides.diff @@ -7,11 +7,11 @@ Subject: [PATCH] yast-provides.diff TagsCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/TagsCheck.py b/TagsCheck.py -index e161aec..dd09e62 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -824,7 +824,7 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -869,7 +869,7 @@ class TagsCheck(AbstractCheck.AbstractCh printWarning(pkg, 'no-url-tag') obs_names = [x[0] for x in pkg.obsoletes()] From 4fa0fae5a0a0a2cbd0923acb959d143bb958d93d497ad3dcdc8207fb59182995 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 18:23:54 +0000 Subject: [PATCH 02/34] - Update to version 84.87+git20170928.d2c55ee: * Remove some outdated sysv init check, we have switched to systemd - add suse-skip-macro-expansion.diff: rename from remove-expand-macros.diff OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=483 --- _servicedata | 2 +- add-weak-dependencies.diff | 12 -------- better-wrong-script.diff | 11 -------- buildroot-doc.diff | 11 -------- buildroot-in-scripts.diff | 11 -------- ...int-tests-84.87+git20170418.092177d.tar.xz | 3 -- ...int-tests-84.87+git20170928.d2c55ee.tar.xz | 3 ++ rpmlint-tests.changes | 6 ++++ rpmlint-tests.spec | 2 +- rpmlint.changes | 1 + rpmlint.spec | 1 + suse-binarieschecks.diff | 28 +++++++++---------- 12 files changed, 26 insertions(+), 65 deletions(-) delete mode 100644 rpmlint-tests-84.87+git20170418.092177d.tar.xz create mode 100644 rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz diff --git a/_servicedata b/_servicedata index fe75923..d6b28e5 100644 --- a/_servicedata +++ b/_servicedata @@ -1,6 +1,6 @@ http://github.com/openSUSE/rpmlint-tests.git - 092177d4fccb48dfb4164faddf11442b63249bff + d2c55ee87053a52d81b33cca0d760fa99588d155 http://github.com/openSUSE/rpmlint-checks.git 8d8fc8774ada96397e437d451b2461b64338db08 \ No newline at end of file diff --git a/add-weak-dependencies.diff b/add-weak-dependencies.diff index ee557df..1ef9934 100644 --- a/add-weak-dependencies.diff +++ b/add-weak-dependencies.diff @@ -1,15 +1,3 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:39 +0200 -Subject: [PATCH] add-weak-dependencies.diff - -=================================================================== ---- - Pkg.py | 29 +++++++++++++++++++++++++++-- - TagsCheck.py | 19 +++++++++++++++++++ - 2 files changed, 46 insertions(+), 2 deletions(-) - -Index: rpmlint-rpmlint-1.10/Pkg.py -=================================================================== --- rpmlint-rpmlint-1.10.orig/Pkg.py +++ rpmlint-rpmlint-1.10/Pkg.py @@ -494,6 +494,10 @@ class Pkg(AbstractPkg): diff --git a/better-wrong-script.diff b/better-wrong-script.diff index fc8c37a..0159dd2 100644 --- a/better-wrong-script.diff +++ b/better-wrong-script.diff @@ -1,14 +1,3 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:38 +0200 -Subject: [PATCH] better-wrong-script.diff - -=================================================================== ---- - FilesCheck.py | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -Index: rpmlint-rpmlint-1.9/FilesCheck.py -=================================================================== --- rpmlint-rpmlint-1.9.orig/FilesCheck.py +++ rpmlint-rpmlint-1.9/FilesCheck.py @@ -1249,7 +1249,10 @@ executed.''', diff --git a/buildroot-doc.diff b/buildroot-doc.diff index e6cd13a..0e76117 100644 --- a/buildroot-doc.diff +++ b/buildroot-doc.diff @@ -1,14 +1,3 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:38 +0200 -Subject: [PATCH] buildroot-doc.diff - -=================================================================== ---- - SpecCheck.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -Index: rpmlint-rpmlint-1.10/SpecCheck.py -=================================================================== --- rpmlint-rpmlint-1.10.orig/SpecCheck.py +++ rpmlint-rpmlint-1.10/SpecCheck.py @@ -670,7 +670,7 @@ versions you can ignore this warning.''' diff --git a/buildroot-in-scripts.diff b/buildroot-in-scripts.diff index 017ad32..37b7cd7 100644 --- a/buildroot-in-scripts.diff +++ b/buildroot-in-scripts.diff @@ -1,14 +1,3 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:39 +0200 -Subject: [PATCH] buildroot-in-scripts.diff - -=================================================================== ---- - SpecCheck.py | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -Index: rpmlint-rpmlint-1.10/SpecCheck.py -=================================================================== --- rpmlint-rpmlint-1.10.orig/SpecCheck.py +++ rpmlint-rpmlint-1.10/SpecCheck.py @@ -235,7 +235,9 @@ class SpecCheck(AbstractCheck.AbstractCh diff --git a/rpmlint-tests-84.87+git20170418.092177d.tar.xz b/rpmlint-tests-84.87+git20170418.092177d.tar.xz deleted file mode 100644 index c833378..0000000 --- a/rpmlint-tests-84.87+git20170418.092177d.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:31d10b7286df08b73336c314ade702381f09913ad141a6a2b5c16cefe3ddf784 -size 11452 diff --git a/rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz b/rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz new file mode 100644 index 0000000..3defcde --- /dev/null +++ b/rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:300fe9dd0a582aac7536644fdcac5859b8be789015975443e0d415f25f2a0927 +size 11260 diff --git a/rpmlint-tests.changes b/rpmlint-tests.changes index 7be06f2..43aa240 100644 --- a/rpmlint-tests.changes +++ b/rpmlint-tests.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 28 12:47:02 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version 84.87+git20170928.d2c55ee: + * Remove some outdated sysv init check, we have switched to systemd + ------------------------------------------------------------------- Sun Jul 2 16:30:01 UTC 2017 - meissner@suse.com diff --git a/rpmlint-tests.spec b/rpmlint-tests.spec index 199ba4c..cbabf35 100644 --- a/rpmlint-tests.spec +++ b/rpmlint-tests.spec @@ -23,7 +23,7 @@ BuildRequires: rpmlint-Factory-strict BuildRequires: rpmlint-mini Name: rpmlint-tests -Version: 84.87+git20170418.092177d +Version: 84.87+git20170928.d2c55ee Release: 0 Summary: rpmlint regression tests License: SUSE-Public-Domain diff --git a/rpmlint.changes b/rpmlint.changes index c19266f..6ad1e18 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -158,6 +158,7 @@ Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com suse-filesystem.diff: obsolete - drop update_git.sh related stuff: this is obsolete, patches are either supposed to be upstreamed or handled via quilt +- add suse-skip-macro-expansion.diff: rename from remove-expand-macros.diff ------------------------------------------------------------------- Thu Sep 28 09:31:24 UTC 2017 - opensuse-packaging@opensuse.org diff --git a/rpmlint.spec b/rpmlint.spec index 8d793e7..481cc78 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -68,6 +68,7 @@ Patch07: suse-binarieschecks.diff 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 diff --git a/suse-binarieschecks.diff b/suse-binarieschecks.diff index 9bf46b0..9b1f3e7 100644 --- a/suse-binarieschecks.diff +++ b/suse-binarieschecks.diff @@ -42,19 +42,17 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py self.tail = '' self.setgid = False -@@ -167,6 +174,11 @@ class BinaryInfo(object): - if ret: - self.forbidden_calls.append(r_name) +@@ -161,6 +168,9 @@ class BinaryInfo(object): + if BinaryInfo.chroot_call_regex.search(l): + self.chroot = True -+ r = BinaryInfo.gethostbyname_call_regex.search(l) -+ if r: ++ if BinaryInfo.gethostbyname_call_regex.search(l): + self.calls_gethostbyname = True -+ continue + - if is_shlib: - r = BinaryInfo.exit_call_regex.search(l) - if r: -@@ -177,6 +189,14 @@ class BinaryInfo(object): + if BinaryInfo.forbidden_functions: + for r_name, func in BinaryInfo.forbidden_functions.items(): + ret = func['f_regex'].search(l) +@@ -177,6 +187,14 @@ class BinaryInfo(object): fork_called = True continue @@ -69,7 +67,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py # check if we don't have a string that will automatically # waive the presence of a forbidden call if self.forbidden_calls: -@@ -392,13 +412,26 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -392,13 +410,26 @@ class BinariesCheck(AbstractCheck.Abstra continue # stripped ? @@ -97,7 +95,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py if is_shlib: has_lib = True -@@ -453,6 +486,10 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -453,6 +484,10 @@ class BinariesCheck(AbstractCheck.Abstra printWarning(pkg, ec, fname, BinaryInfo.forbidden_functions[ec]['f_name']) @@ -108,7 +106,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py # rpath ? if bin_info.rpath: for p in bin_info.rpath: -@@ -666,6 +703,14 @@ with the intended shared libraries only. +@@ -666,6 +701,14 @@ with the intended shared libraries only. 'ldd-failed', '''Executing ldd on this file failed, all checks could not be run.''', @@ -123,7 +121,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 +723,10 @@ don\'t define a proper .note.GNU-stack s +@@ -678,6 +721,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.''', @@ -134,7 +132,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 +745,12 @@ that use prelink, make sure that prelink +@@ -696,6 +743,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''', From 471cf0d4d916b765925fde32bd5db03759389ff299d2a52041342966256d775a Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 20:18:14 +0000 Subject: [PATCH 03/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=484 --- add-weak-dependencies.diff | 4 +++- better-wrong-script.diff | 8 ++++--- check-for-self-provides.diff | 10 ++++----- confusing-invalid-spec-name.diff | 10 ++++----- description-check.diff | 4 ++-- extend-suse-conffiles-check.diff | 10 ++++----- invalid-filerequires.diff | 4 ++-- libtool-wrapper-check.diff | 4 ++-- no-doc-for-lib.diff | 8 +++---- noarch-lib64.diff | 8 +++---- rpmgroup-checks.diff | 4 ++-- rpmlint-all-pie.patch | 4 ++-- selfconflicts-provide.diff | 6 +++--- stricter-interpreter-check.diff | 8 +++---- suse-binarieschecks.diff | 5 ++--- suse-python-abi-check.diff | 10 ++++----- suse-shlib-devel-dependency.diff | 2 +- suse-skip-macro-expansion.diff | 36 ++++++++++++++++++++++++++++++++ suse-speccheck-utf8.diff | 10 ++++----- suse-whitelist-opensuse.diff | 10 ++++----- usr-arch.diff | 4 ++-- yast-provides.diff | 2 +- 22 files changed, 105 insertions(+), 66 deletions(-) create mode 100644 suse-skip-macro-expansion.diff diff --git a/add-weak-dependencies.diff b/add-weak-dependencies.diff index 1ef9934..2f80cdc 100644 --- a/add-weak-dependencies.diff +++ b/add-weak-dependencies.diff @@ -1,3 +1,5 @@ +Index: rpmlint-rpmlint-1.10/Pkg.py +=================================================================== --- rpmlint-rpmlint-1.10.orig/Pkg.py +++ rpmlint-rpmlint-1.10/Pkg.py @@ -494,6 +494,10 @@ class Pkg(AbstractPkg): @@ -68,7 +70,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -899,8 +899,27 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -889,8 +889,27 @@ class TagsCheck(AbstractCheck.AbstractCh value = Pkg.formatRequire(*c) self._unexpanded_macros(pkg, 'Conflicts %s' % (value,), value) diff --git a/better-wrong-script.diff b/better-wrong-script.diff index 0159dd2..52ca4f8 100644 --- a/better-wrong-script.diff +++ b/better-wrong-script.diff @@ -1,6 +1,8 @@ ---- rpmlint-rpmlint-1.9.orig/FilesCheck.py -+++ rpmlint-rpmlint-1.9/FilesCheck.py -@@ -1249,7 +1249,10 @@ executed.''', +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 diff --git a/check-for-self-provides.diff b/check-for-self-provides.diff index 7deded1..4e3a170 100644 --- a/check-for-self-provides.diff +++ b/check-for-self-provides.diff @@ -6,11 +6,11 @@ Subject: [PATCH] check for self provides TagsCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) -Index: rpmlint-rpmlint-1.9/TagsCheck.py +Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== ---- rpmlint-rpmlint-1.9.orig/TagsCheck.py -+++ rpmlint-rpmlint-1.9/TagsCheck.py -@@ -901,6 +901,8 @@ class TagsCheck(AbstractCheck.AbstractCh +--- 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) @@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.9/TagsCheck.py for c in pkg.conflicts(): value = Pkg.formatRequire(*c) -@@ -1252,6 +1254,10 @@ objects should thus not be depended on a +@@ -1234,6 +1236,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.''', diff --git a/confusing-invalid-spec-name.diff b/confusing-invalid-spec-name.diff index 26b5ced..743737d 100644 --- a/confusing-invalid-spec-name.diff +++ b/confusing-invalid-spec-name.diff @@ -8,11 +8,11 @@ Subject: [PATCH] confusing-invalid-spec-name SpecCheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/SpecCheck.py b/SpecCheck.py -index 0d77a03..739410f 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -647,8 +647,8 @@ addDetails( +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', diff --git a/description-check.diff b/description-check.diff index a3c562e..3dad7d3 100644 --- a/description-check.diff +++ b/description-check.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -746,6 +746,9 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -736,6 +736,9 @@ class TagsCheck(AbstractCheck.AbstractCh else: for lang in langs: self.check_description(pkg, lang, ignored_words) @@ -21,7 +21,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py else: printError(pkg, 'no-description-tag') -@@ -1046,6 +1049,10 @@ Name tag.''', +@@ -1028,6 +1031,10 @@ Name tag.''', '''The major number of the library isn't included in the package's name. ''', diff --git a/extend-suse-conffiles-check.diff b/extend-suse-conffiles-check.diff index 98e1ee7..23876d0 100644 --- a/extend-suse-conffiles-check.diff +++ b/extend-suse-conffiles-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] extend-suse-conffiles-check.diff FilesCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 24029f1..a8ac7f4 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -1202,7 +1202,7 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -803,7 +803,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 \ diff --git a/invalid-filerequires.diff b/invalid-filerequires.diff index 7c9871b..e3ac63b 100644 --- a/invalid-filerequires.diff +++ b/invalid-filerequires.diff @@ -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) -@@ -642,6 +643,9 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -632,6 +633,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]) -@@ -1199,6 +1203,12 @@ unneeded explicit Requires: tags.''', +@@ -1181,6 +1185,12 @@ unneeded explicit Requires: tags.''', '''This package provides 2 times the same capacity. It should only provide it once.''', diff --git a/libtool-wrapper-check.diff b/libtool-wrapper-check.diff index b1dbabb..455012a 100644 --- a/libtool-wrapper-check.diff +++ b/libtool-wrapper-check.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/BinariesCheck.py +++ rpmlint-rpmlint-1.10/BinariesCheck.py -@@ -370,8 +370,19 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -367,8 +367,19 @@ 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 @@ -31,7 +31,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py if not is_binary: if reference_regex.search(fname): lines = pkg.grep(invalid_dir_ref_regex, fname) -@@ -640,6 +651,15 @@ to list code compiled without -fPIC. +@@ -637,6 +648,15 @@ to list code compiled without -fPIC. Another common mistake that causes this problem is linking with ``gcc -Wl,-shared'' instead of ``gcc -shared''.''', diff --git a/no-doc-for-lib.diff b/no-doc-for-lib.diff index 19e3081..66a8f06 100644 --- a/no-doc-for-lib.diff +++ b/no-doc-for-lib.diff @@ -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.9/FilesCheck.py +Index: rpmlint-rpmlint-1.10/FilesCheck.py =================================================================== ---- rpmlint-rpmlint-1.9.orig/FilesCheck.py -+++ rpmlint-rpmlint-1.9/FilesCheck.py -@@ -434,7 +434,7 @@ class FilesCheck(AbstractCheck.AbstractC +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -440,7 +440,7 @@ class FilesCheck(AbstractCheck.AbstractC debuginfo_srcs = False debuginfo_debugs = False diff --git a/noarch-lib64.diff b/noarch-lib64.diff index f94006b..762f7e0 100644 --- a/noarch-lib64.diff +++ b/noarch-lib64.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/BinariesCheck.py +++ rpmlint-rpmlint-1.10/BinariesCheck.py -@@ -348,6 +348,7 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -345,6 +345,7 @@ class BinariesCheck(AbstractCheck.Abstra binary = False binary_in_usr_lib = False has_usr_lib_file = False @@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py multi_pkg = False srpm = pkg[rpm.RPMTAG_SOURCERPM] -@@ -366,6 +367,10 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -363,6 +364,10 @@ class BinariesCheck(AbstractCheck.Abstra # only-non-binary-in-usr-lib false positives binary_in_usr_lib = True @@ -30,7 +30,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py is_elf = 'ELF' in pkgfile.magic is_ar = 'current ar archive' in pkgfile.magic is_ocaml_native = 'Objective caml native' in pkgfile.magic -@@ -599,9 +604,12 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -596,9 +601,12 @@ class BinariesCheck(AbstractCheck.Abstra if version and version != -1 and version not in pkg.name: printError(pkg, 'incoherent-version-in-name', version) @@ -44,7 +44,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py if has_usr_lib_file and not binary_in_usr_lib: printWarning(pkg, 'only-non-binary-in-usr-lib') -@@ -626,6 +634,11 @@ FHS and the FSSTND forbid this.''', +@@ -623,6 +631,11 @@ FHS and the FSSTND forbid this.''', # 'non-sparc32-binary', # '', diff --git a/rpmgroup-checks.diff b/rpmgroup-checks.diff index ba3b5c3..4b04486 100644 --- a/rpmgroup-checks.diff +++ b/rpmgroup-checks.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -753,6 +753,8 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -743,6 +743,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) -@@ -1085,6 +1087,10 @@ won't fool the specfile parser, and rebu +@@ -1067,6 +1069,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.''', diff --git a/rpmlint-all-pie.patch b/rpmlint-all-pie.patch index a760bba..2aaa37e 100644 --- a/rpmlint-all-pie.patch +++ b/rpmlint-all-pie.patch @@ -2,7 +2,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/BinariesCheck.py +++ rpmlint-rpmlint-1.10/BinariesCheck.py -@@ -537,6 +537,9 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -534,6 +534,9 @@ class BinariesCheck(AbstractCheck.Abstra if not is_shobj and pie_exec_re and pie_exec_re.search(fname): printError(pkg, 'non-position-independent-executable', fname) @@ -12,7 +12,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py if bin_info.readelf_error: continue -@@ -789,6 +792,10 @@ stripping process.''', +@@ -786,6 +789,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.''', diff --git a/selfconflicts-provide.diff b/selfconflicts-provide.diff index 7bb096f..1683c58 100644 --- a/selfconflicts-provide.diff +++ b/selfconflicts-provide.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -875,6 +875,7 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -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()] @@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py for o in (x for x in obs_names if x not in prov_names): printWarning(pkg, 'obsolete-not-provided', o) -@@ -886,6 +887,8 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -876,6 +877,8 @@ class TagsCheck(AbstractCheck.AbstractCh # https://bugzilla.redhat.com/460872 useless_provides = [] for p in prov_names: @@ -28,7 +28,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py if prov_names.count(p) != 1 and p not in useless_provides: useless_provides.append(p) for p in useless_provides: -@@ -1048,6 +1051,10 @@ the Release tag.''', +@@ -1030,6 +1033,10 @@ the Release tag.''', '''There is no Name tag in your package. You have to specify a name using the Name tag.''', diff --git a/stricter-interpreter-check.diff b/stricter-interpreter-check.diff index 4f87cd6..cd779ef 100644 --- a/stricter-interpreter-check.diff +++ b/stricter-interpreter-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] stricter-interpreter-check.diff FilesCheck.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -Index: rpmlint-rpmlint-1.9/FilesCheck.py +Index: rpmlint-rpmlint-1.10/FilesCheck.py =================================================================== ---- rpmlint-rpmlint-1.9.orig/FilesCheck.py -+++ rpmlint-rpmlint-1.9/FilesCheck.py -@@ -853,7 +853,8 @@ class FilesCheck(AbstractCheck.AbstractC +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -869,7 +869,8 @@ class FilesCheck(AbstractCheck.AbstractC f.endswith('.la')): printError(pkg, 'script-without-shebang', f) diff --git a/suse-binarieschecks.diff b/suse-binarieschecks.diff index 9b1f3e7..73790c2 100644 --- a/suse-binarieschecks.diff +++ b/suse-binarieschecks.diff @@ -20,14 +20,13 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py import Pkg -@@ -56,6 +56,10 @@ class BinaryInfo(object): +@@ -56,6 +56,9 @@ class BinaryInfo(object): chroot_call_regex = create_regexp_call('chroot') # 401eb8: e8 c3 f0 ff ff callq 400f80 objdump_call_regex = re.compile(br'callq?\s(.*)') + debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+') + symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+') -+ gethostbyname_call_regex = create_regexp_call(['gethostbyname', 'gethostbyname2', -+ 'gethostbyaddr', 'gethostbyname_r', 'gethostbyname2_r', 'gethostbyaddr_r']) ++ gethostbyname_call_regex = gethostbyname_call_regex = create_regexp_call(r'(gethostbyname|gethostbyname2|gethostbyaddr|gethostbyname_r|gethostbyname2_r|gethostbyaddr_r)') forbidden_functions = Config.getOption("WarnOnFunction") if forbidden_functions: diff --git a/suse-python-abi-check.diff b/suse-python-abi-check.diff index b680c3d..24d63eb 100644 --- a/suse-python-abi-check.diff +++ b/suse-python-abi-check.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-python-abi-check.diff FilesCheck.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index f73cda1..806b886 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -1132,8 +1132,11 @@ class FilesCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/FilesCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/FilesCheck.py ++++ rpmlint-rpmlint-1.10/FilesCheck.py +@@ -733,8 +733,11 @@ class FilesCheck(AbstractCheck.AbstractC if res and not (pkg.check_versioned_dep('python-base', res.group(1)) or pkg.check_versioned_dep('python', diff --git a/suse-shlib-devel-dependency.diff b/suse-shlib-devel-dependency.diff index ed75edc..d68afc7 100644 --- a/suse-shlib-devel-dependency.diff +++ b/suse-shlib-devel-dependency.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -673,10 +673,10 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -663,10 +663,10 @@ class TagsCheck(AbstractCheck.AbstractCh if pkg_config_regex.match(fname) and fname.endswith('.pc'): has_pc = True if has_so: diff --git a/suse-skip-macro-expansion.diff b/suse-skip-macro-expansion.diff new file mode 100644 index 0000000..99da111 --- /dev/null +++ b/suse-skip-macro-expansion.diff @@ -0,0 +1,36 @@ +Index: rpmlint-rpmlint-1.10/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 + # we assume that no rpm packages existed before rpm itself existed... + oldest_changelog_timestamp = calendar.timegm(time.strptime("1995-01-01", "%Y-%m-%d")) + +-private_so_paths = set() +-for path in ('%perl_archlib', '%perl_vendorarch', '%perl_sitearch', +- '%python_sitearch', '%python2_sitearch', '%python3_sitearch', +- '%ruby_sitearch', '%php_extdir'): +- epath = rpm.expandMacro(path) +- if epath and epath != path: +- private_so_paths.add(epath) +- private_so_paths.add(re.sub(r'/lib64(?=/|$)', '/lib', epath)) +- private_so_paths.add(re.sub(r'/lib(?=/|$)', '/lib64', epath)) +- + _enchant_checkers = {} + + +@@ -921,14 +911,6 @@ class TagsCheck(AbstractCheck.AbstractCh + res = Pkg.b2s(pkg[getattr(rpm, 'RPMTAG_%s' % tag.upper())]) + self._unexpanded_macros(pkg, tag, res) + +- for path in private_so_paths: +- for fname, pkgfile in pkg.files().items(): +- if fname.startswith(path): +- for prov in pkgfile.provides: +- if so_dep_regex.search(prov[0]): +- printWarning(pkg, "private-shared-object-provides", +- fname, Pkg.formatRequire(*prov)) +- + def check_description(self, pkg, lang, ignored_words): + description = pkg.langtag(rpm.RPMTAG_DESCRIPTION, lang) + if use_utf8: diff --git a/suse-speccheck-utf8.diff b/suse-speccheck-utf8.diff index 6c53c72..a6c739f 100644 --- a/suse-speccheck-utf8.diff +++ b/suse-speccheck-utf8.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-speccheck-utf8.diff SpecCheck.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -diff --git a/SpecCheck.py b/SpecCheck.py -index 739410f..4dafdb9 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py -@@ -651,8 +651,8 @@ SPEC file to build a valid RPM package.''', +Index: rpmlint-rpmlint-1.10/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.' ("Name:" tag). Either rename your package or the specfile.''', 'non-utf8-spec-file', diff --git a/suse-whitelist-opensuse.diff b/suse-whitelist-opensuse.diff index d433463..c41bc31 100644 --- a/suse-whitelist-opensuse.diff +++ b/suse-whitelist-opensuse.diff @@ -7,11 +7,11 @@ Subject: [PATCH] suse-whitelist-opensuse.diff TagsCheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/TagsCheck.py b/TagsCheck.py -index 3f9c0bc..9856f9e 100644 ---- a/TagsCheck.py -+++ b/TagsCheck.py -@@ -918,7 +918,7 @@ class TagsCheck(AbstractCheck.AbstractCheck): +Index: rpmlint-rpmlint-1.10/TagsCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/TagsCheck.py ++++ rpmlint-rpmlint-1.10/TagsCheck.py +@@ -972,7 +972,7 @@ class TagsCheck(AbstractCheck.AbstractCh spell_check(pkg, summary, 'Summary(%s)', lang, ignored_words) if '\n' in summary: printError(pkg, 'summary-on-multiple-lines', lang) diff --git a/usr-arch.diff b/usr-arch.diff index fe52b03..b8f7cd6 100644 --- a/usr-arch.diff +++ b/usr-arch.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/BinariesCheck.py +++ rpmlint-rpmlint-1.10/BinariesCheck.py -@@ -324,6 +324,7 @@ usr_lib_exception_regex = re.compile(Con +@@ -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$') @@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py def dir_base(path): -@@ -397,7 +398,7 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -394,7 +395,7 @@ class BinariesCheck(AbstractCheck.Abstra # arch dependent packages only from here on # in /usr/share ? diff --git a/yast-provides.diff b/yast-provides.diff index fe2131b..4b62647 100644 --- a/yast-provides.diff +++ b/yast-provides.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -869,7 +869,7 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -859,7 +859,7 @@ class TagsCheck(AbstractCheck.AbstractCh printWarning(pkg, 'no-url-tag') obs_names = [x[0] for x in pkg.obsoletes()] From 94d6d5f985ae296f7d5e9705ca7f76d0cf563d18c03c286976f81c6a4bf3d52a Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 20:25:27 +0000 Subject: [PATCH 04/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=485 --- suse-binarieschecks.diff | 66 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/suse-binarieschecks.diff b/suse-binarieschecks.diff index 73790c2..8ced32e 100644 --- a/suse-binarieschecks.diff +++ b/suse-binarieschecks.diff @@ -24,24 +24,39 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py chroot_call_regex = create_regexp_call('chroot') # 401eb8: e8 c3 f0 ff ff callq 400f80 objdump_call_regex = re.compile(br'callq?\s(.*)') -+ debuginfo_regex=re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+') -+ symtab_regex=re.compile('^\s+\[\s*\d+\]\s+\.symtab\s+') -+ gethostbyname_call_regex = gethostbyname_call_regex = create_regexp_call(r'(gethostbyname|gethostbyname2|gethostbyaddr|gethostbyname_r|gethostbyname2_r|gethostbyaddr_r)') ++ debuginfo_regex = re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+') ++ symtab_regex = re.compile('^\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 +88,10 @@ class BinaryInfo(object): +@@ -84,7 +87,10 @@ class BinaryInfo(object): self.exec_stack = False self.exit_calls = [] self.forbidden_calls = [] + self.calls_gethostbyname = False fork_called = False -+ self.debuginfo = 0 -+ self.symtab=0 ++ self.debuginfo = False ++ self.symtab = False self.tail = '' self.setgid = False -@@ -161,6 +168,9 @@ class BinaryInfo(object): +@@ -121,6 +127,14 @@ class BinaryInfo(object): + self.non_pic = False + continue + ++ if BinaryInfo.debuginfo_regex.search(l): ++ self.debuginfo = True ++ continue ++ ++ if BinaryInfo.symtab_regex.search(l): ++ self.symtab = True ++ continue ++ + r = BinaryInfo.soname_regex.search(l) + if r: + self.soname = r.group(1) +@@ -161,6 +175,9 @@ class BinaryInfo(object): if BinaryInfo.chroot_call_regex.search(l): self.chroot = True @@ -51,29 +66,14 @@ 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) -@@ -177,6 +187,14 @@ class BinaryInfo(object): - fork_called = True - continue - -+ if BinaryInfo.debuginfo_regex.search(l): -+ self.debuginfo=1 -+ continue -+ -+ if BinaryInfo.symtab_regex.search(l): -+ self.symtab=1 -+ continue -+ - # check if we don't have a string that will automatically - # waive the presence of a forbidden call - if self.forbidden_calls: -@@ -392,13 +410,26 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -392,13 +409,26 @@ class BinariesCheck(AbstractCheck.Abstra continue # stripped ? - if 'not stripped' in pkgfile.magic: -+ if 'not stripped' in pkgfile.magic and \ -+ (os.environ.get('BUILD_DIR', '') == '' or -+ os.environ.get('BUILD_DEBUG', '') != ''): ++ if ('not stripped' in pkgfile.magic and ++ (os.environ.get('BUILD_DIR', '') == '' or ++ os.environ.get('BUILD_DEBUG', '') != '')): printWarning(pkg, 'unstripped-binary-or-object', fname) # inspect binary file @@ -86,15 +86,15 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py + pass + elif not bin_info.symtab: + printError(pkg, 'static-library-without-symtab', fname) -+ elif not bin_info.debuginfo and \ -+ (os.environ.get('BUILD_DIR', '') == '' or \ -+ os.environ.get('BUILD_DEBUG','') != ''): ++ elif (not bin_info.debuginfo and ++ (os.environ.get('BUILD_DIR', '') == '' or ++ os.environ.get('BUILD_DEBUG', '') != '')): + printWarning(pkg, 'static-library-without-debuginfo', fname) + if is_shlib: has_lib = True -@@ -453,6 +484,10 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -453,6 +483,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 +701,14 @@ with the intended shared libraries only. +@@ -666,6 +700,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 +721,10 @@ don\'t define a proper .note.GNU-stack s +@@ -678,6 +720,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 +743,12 @@ that use prelink, make sure that prelink +@@ -696,6 +742,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''', From 608ba7ddde0e19ab5c454400bf93ccd4d5ffe29e425fe90041017420683ba3a3 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 20:36:34 +0000 Subject: [PATCH 05/34] - drop sourced-dirs.diff, fix-shared-library-matching.diff, suse-python-abi-check.diff: obsolete OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=486 --- rpmlint.changes | 2 +- rpmlint.spec | 1 - suse-python-abi-check.diff | 27 --------------------------- 3 files changed, 1 insertion(+), 29 deletions(-) delete mode 100644 suse-python-abi-check.diff diff --git a/rpmlint.changes b/rpmlint.changes index 6ad1e18..954f63a 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -67,7 +67,7 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com * test: Test for unexpected errors in default and C locales * Remove obsolete LC_ALL setting from Makefile - drop version-control-internal-file.diff, boo1027577-license_tag.patch: upstream -- drop sourced-dirs.diff, fix-shared-library-matching.diff: obsolete +- drop sourced-dirs.diff, fix-shared-library-matching.diff, suse-python-abi-check.diff: obsolete - drop suse-readd_terminator_in_regex.patch: merged into original patch - add suse-tests-without-badness.patch diff --git a/rpmlint.spec b/rpmlint.spec index 481cc78..35c6032 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -95,7 +95,6 @@ Patch48: suse-whitelist-opensuse.diff Patch49: extend-suse-conffiles-check.diff Patch50: compressed-backup-regex.diff Patch51: suse-speccheck-utf8.diff -Patch52: suse-python-abi-check.diff Patch53: suse-manpages-for-rc-scripts.diff Patch54: suse-ignore-specfile-errors.diff Patch55: invalid-filerequires.diff diff --git a/suse-python-abi-check.diff b/suse-python-abi-check.diff deleted file mode 100644 index 24d63eb..0000000 --- a/suse-python-abi-check.diff +++ /dev/null @@ -1,27 +0,0 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:40 +0200 -Subject: [PATCH] suse-python-abi-check.diff - -=================================================================== ---- - FilesCheck.py | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -Index: rpmlint-rpmlint-1.10/FilesCheck.py -=================================================================== ---- rpmlint-rpmlint-1.10.orig/FilesCheck.py -+++ rpmlint-rpmlint-1.10/FilesCheck.py -@@ -733,8 +733,11 @@ class FilesCheck(AbstractCheck.AbstractC - if res and not (pkg.check_versioned_dep('python-base', - res.group(1)) or - pkg.check_versioned_dep('python', -- res.group(1))): -- printError(pkg, 'no-dependency-on', 'python-base', -+ res.group(1)) or -+ pkg.check_versioned_dep('python(abi)', -+ res.group(1)) -+ ): -+ printError(pkg, 'no-dependency-on', 'python(abi)', - res.group(1)) - python_dep_error = True - From 7aa2b48d0fdd749fa53e150447132321b9b47a6f098d28487af9cfcc7a113a5f Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 20:40:41 +0000 Subject: [PATCH 06/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=487 --- suse-shlib-devel-dependency.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/suse-shlib-devel-dependency.diff b/suse-shlib-devel-dependency.diff index d68afc7..25ddbbe 100644 --- a/suse-shlib-devel-dependency.diff +++ b/suse-shlib-devel-dependency.diff @@ -16,7 +16,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py has_pc = True if has_so: - base_or_libs = base + '/' + base + '-libs/lib' + base -+ base_or_libs = base + '/' + base + '-libs/lib' + base + '*' ++ base_or_libs = base + '*' + '/' + base + '-libs/lib' + base + '*' # try to match *%_isa as well (e.g. "(x86-64)", "(x86-32)") base_or_libs_re = re.compile( - r'^(lib)?%s(-libs)?(\(\w+-\d+\))?$' % re.escape(base)) From f1103009631ba2c9e2a66a5625f775f5eb33217175ebcf856e95c9b7d20b9617 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 21:08:20 +0000 Subject: [PATCH 07/34] - add suse-tests-without-badness.patch, 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch, 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=488 --- ...gex-to-capture-more-SCM-system-files.patch | 47 ++++++++++++++++ ...x-to-avoid-false-positive-in-python-.patch | 53 +++++++++++++++++++ rpmlint.changes | 4 +- rpmlint.spec | 2 + 4 files changed, 105 insertions(+), 1 deletion(-) create mode 100644 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch create mode 100644 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch diff --git a/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch b/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch new file mode 100644 index 0000000..22a4d69 --- /dev/null +++ b/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch @@ -0,0 +1,47 @@ +From 1d70b641e5f755de72b0fa0059d4979a79f9553c Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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(-) + +diff --git a/FilesCheck.py b/FilesCheck.py +index a7724de..87965bc 100644 +--- a/FilesCheck.py ++++ b/FilesCheck.py +@@ -201,7 +201,9 @@ 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) + 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) +diff --git a/test/test_files.py b/test/test_files.py +index 469a227..f26c0c3 100644 +--- a/test/test_files.py ++++ b/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') +-- +2.14.1 + diff --git a/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch b/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch new file mode 100644 index 0000000..273f57c --- /dev/null +++ b/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch @@ -0,0 +1,53 @@ +From bcc9a315dae3aacf27854f16328c59e32eab2816 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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(-) + +diff --git a/FilesCheck.py b/FilesCheck.py +index 57de8fb..1852b38 100644 +--- a/FilesCheck.py ++++ b/FilesCheck.py +@@ -196,7 +196,7 @@ devel_regex = re.compile(r'(.*)-(debug(info|source)?|devel|headers|source|static + 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\.]+|\.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) +diff --git a/test/test_files.py b/test/test_files.py +index f26c0c3..bfffda5 100644 +--- a/test/test_files.py ++++ b/test/test_files.py +@@ -62,3 +62,20 @@ 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', ++ '/lib64/libSegFault.so', ++ '/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/lib64/rsocket/binary',)) +-- +2.14.1 + diff --git a/rpmlint.changes b/rpmlint.changes index 954f63a..18798ee 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -69,7 +69,9 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com - drop version-control-internal-file.diff, boo1027577-license_tag.patch: upstream - drop sourced-dirs.diff, fix-shared-library-matching.diff, suse-python-abi-check.diff: obsolete - drop suse-readd_terminator_in_regex.patch: merged into original patch -- add suse-tests-without-badness.patch +- add suse-tests-without-badness.patch, + 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch, + 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch ------------------------------------------------------------------- Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com diff --git a/rpmlint.spec b/rpmlint.spec index 35c6032..eff06af 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -100,6 +100,8 @@ Patch54: suse-ignore-specfile-errors.diff Patch55: invalid-filerequires.diff Patch57: check-for-self-provides.diff Patch58: add-check-for-tmpfiles-created-at-r.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 Patch70: rpmlint-all-pie.patch # PATCHLIST END # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 From aca89521ba538dc3bfa7939cd78717111b7b9054f4494de015ff76484ba19d3a Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 21:17:43 +0000 Subject: [PATCH 08/34] - Update to version 84.87+git20170928.27b6cb3: * Adjustments for newer rpmlint OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=489 --- _servicedata | 2 +- rpmlint-tests.changes | 6 ++++++ rpmlint-tests.spec | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/_servicedata b/_servicedata index d6b28e5..47815ab 100644 --- a/_servicedata +++ b/_servicedata @@ -1,6 +1,6 @@ http://github.com/openSUSE/rpmlint-tests.git - d2c55ee87053a52d81b33cca0d760fa99588d155 + 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 http://github.com/openSUSE/rpmlint-checks.git 8d8fc8774ada96397e437d451b2461b64338db08 \ No newline at end of file diff --git a/rpmlint-tests.changes b/rpmlint-tests.changes index 43aa240..a8d1dd0 100644 --- a/rpmlint-tests.changes +++ b/rpmlint-tests.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Sep 28 21:16:42 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version 84.87+git20170928.27b6cb3: + * Adjustments for newer rpmlint + ------------------------------------------------------------------- Thu Sep 28 12:47:02 UTC 2017 - opensuse-packaging@opensuse.org diff --git a/rpmlint-tests.spec b/rpmlint-tests.spec index cbabf35..645f111 100644 --- a/rpmlint-tests.spec +++ b/rpmlint-tests.spec @@ -23,7 +23,7 @@ BuildRequires: rpmlint-Factory-strict BuildRequires: rpmlint-mini Name: rpmlint-tests -Version: 84.87+git20170928.d2c55ee +Version: 84.87+git20170928.27b6cb3 Release: 0 Summary: rpmlint regression tests License: SUSE-Public-Domain From 38fb33af67bcbaab5eeb39e41248dbd91a3b83344b76d353620ad315b40f67a7 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 21:23:56 +0000 Subject: [PATCH 09/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=490 --- rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz | 3 +++ rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz delete mode 100644 rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz diff --git a/rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz b/rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz new file mode 100644 index 0000000..e506e69 --- /dev/null +++ b/rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ee29044ba89b88fb014a1c09760cbda60f210f63225c0a4a778f59d5eba7622 +size 11192 diff --git a/rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz b/rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz deleted file mode 100644 index 3defcde..0000000 --- a/rpmlint-tests-84.87+git20170928.d2c55ee.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:300fe9dd0a582aac7536644fdcac5859b8be789015975443e0d415f25f2a0927 -size 11260 From 542af50a094ae0d542c780d8d4646243d68ab6f99af7f0d948ce7a06a328be16 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 21:26:00 +0000 Subject: [PATCH 10/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=491 --- rpmlint.spec | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rpmlint.spec b/rpmlint.spec index eff06af..35c89dd 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -48,15 +48,9 @@ Requires: desktop-file-utils Requires: file Requires: findutils Requires: python-magic +Requires: python-pybeam Requires: python-xml Requires: rpm-python -# Requirement for ErlangCheck.py (pull-request #2). -Requires: python-pybeam -# -# Read README.packaging.txt before making any changes to this -# package -# -# PATCHLIST BEGIN Patch00: rpmlint-suse.diff Patch01: suse-checks.diff Patch02: suse-version.diff @@ -103,7 +97,6 @@ Patch58: add-check-for-tmpfiles-created-at-r.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 Patch70: rpmlint-all-pie.patch -# PATCHLIST END # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 BuildArch: noarch From 24e9388d4b703b580485fcf3be590b6686234a116bd5dd7056df846827b601cf Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Thu, 28 Sep 2017 22:01:58 +0000 Subject: [PATCH 11/34] 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, 0001-Execute-chroot-tests-also-on-x86-rpms.patch OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=492 --- ...xecute-chroot-tests-also-on-x86-rpms.patch | 37 +++++++++++++++++++ rpmlint.changes | 3 +- rpmlint.spec | 1 + 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 0001-Execute-chroot-tests-also-on-x86-rpms.patch diff --git a/0001-Execute-chroot-tests-also-on-x86-rpms.patch b/0001-Execute-chroot-tests-also-on-x86-rpms.patch new file mode 100644 index 0000000..4f6409b --- /dev/null +++ b/0001-Execute-chroot-tests-also-on-x86-rpms.patch @@ -0,0 +1,37 @@ +From 9140901be1ab2c41df6ec7b21bd68e2e695b201f Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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(-) + +diff --git a/BinariesCheck.py b/BinariesCheck.py +index 887e0f0..26983bb 100644 +--- a/BinariesCheck.py ++++ b/BinariesCheck.py +@@ -206,7 +206,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")) +@@ -531,7 +532,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck): + 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) + +-- +2.14.1 + diff --git a/rpmlint.changes b/rpmlint.changes index 18798ee..3cd587d 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -71,7 +71,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com - drop suse-readd_terminator_in_regex.patch: merged into original patch - add suse-tests-without-badness.patch, 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch, - 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch + 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, + 0001-Execute-chroot-tests-also-on-x86-rpms.patch ------------------------------------------------------------------- Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com diff --git a/rpmlint.spec b/rpmlint.spec index 35c89dd..5d6d6df 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -96,6 +96,7 @@ Patch57: check-for-self-provides.diff Patch58: add-check-for-tmpfiles-created-at-r.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 Patch70: rpmlint-all-pie.patch # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 BuildArch: noarch From 9b471c162a5bf0980879345ff56028937fbc5f9b4d3c93be1401154ca7799adf Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 29 Sep 2017 05:05:52 +0000 Subject: [PATCH 12/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=493 --- description-check.diff | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/description-check.diff b/description-check.diff index 3dad7d3..3e51b92 100644 --- a/description-check.diff +++ b/description-check.diff @@ -16,7 +16,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py for lang in langs: self.check_description(pkg, lang, ignored_words) + -+ if len(pkg[rpm.RPMTAG_DESCRIPTION].partition('Authors:')[0])-4 < len(pkg[rpm.RPMTAG_SUMMARY]): ++ 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') From 5474cb37a107e6fdb838be6fc25771d4959bb3dd9e85d3392682d017fecc5e06 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 29 Sep 2017 12:06:07 +0000 Subject: [PATCH 13/34] 0001-Execute-chroot-tests-also-on-x86-rpms.patch, ignore-readelf-ar-error.diff OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=494 --- ignore-readelf-ar-error.diff | 16 ++++++++++++++++ libtool-wrapper-check.diff | 4 ++-- rpmlint.changes | 3 ++- rpmlint.spec | 1 + 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 ignore-readelf-ar-error.diff diff --git a/ignore-readelf-ar-error.diff b/ignore-readelf-ar-error.diff new file mode 100644 index 0000000..145c491 --- /dev/null +++ b/ignore-readelf-ar-error.diff @@ -0,0 +1,16 @@ +--- a/BinariesCheck.py ++++ b/BinariesCheck.py +@@ -240,8 +240,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: diff --git a/libtool-wrapper-check.diff b/libtool-wrapper-check.diff index 455012a..e0141b0 100644 --- a/libtool-wrapper-check.diff +++ b/libtool-wrapper-check.diff @@ -20,9 +20,9 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py + if is_shell: + count= 0 -+ for l in open(pkgfile.path, "r"): ++ for l in open(pkgfile.path, 'rb'): + count = count + 1 -+ if (l.find("This wrapper script should never be moved out of the build directory") != -1): ++ if (l.find(b'This wrapper script should never be moved out of the build directory') != -1): + printError(pkg, 'libtool-wrapper-in-package', fname) + break + if (count > 20): diff --git a/rpmlint.changes b/rpmlint.changes index 3cd587d..49cc396 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -72,7 +72,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com - add suse-tests-without-badness.patch, 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch, 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, - 0001-Execute-chroot-tests-also-on-x86-rpms.patch + 0001-Execute-chroot-tests-also-on-x86-rpms.patch, + ignore-readelf-ar-error.diff ------------------------------------------------------------------- Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com diff --git a/rpmlint.spec b/rpmlint.spec index 5d6d6df..e72913b 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -97,6 +97,7 @@ Patch58: add-check-for-tmpfiles-created-at-r.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 Patch70: rpmlint-all-pie.patch # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 BuildArch: noarch From 46062032f57c728647751106e939a3314eac215db64b6ab68027dba010ee1312 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 29 Sep 2017 12:08:51 +0000 Subject: [PATCH 14/34] - Update to version master: * Flake8 fixes * Properly anchor systemd path checks * Python 3.x porting - Update rpmlint-checks: * Flake8 fixes * Properly anchor systemd path checks * Python 3.x porting OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=495 --- _servicedata | 2 +- rpmlint-checks-master.tar.xz | 4 ++-- rpmlint-tests.changes | 8 ++++++++ rpmlint-tests.spec | 2 +- rpmlint.changes | 8 ++++++++ 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/_servicedata b/_servicedata index 47815ab..18d2add 100644 --- a/_servicedata +++ b/_servicedata @@ -3,4 +3,4 @@ http://github.com/openSUSE/rpmlint-tests.git 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 http://github.com/openSUSE/rpmlint-checks.git - 8d8fc8774ada96397e437d451b2461b64338db08 \ No newline at end of file + 25f3752a0a5e8ab95aedee8504afddfe8d9b7e51 \ No newline at end of file diff --git a/rpmlint-checks-master.tar.xz b/rpmlint-checks-master.tar.xz index 92f57a1..ec8a4bf 100644 --- a/rpmlint-checks-master.tar.xz +++ b/rpmlint-checks-master.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d64b3726bf7a3353f1806e1f06afebd42bb934e84c87013f5a84381137579e79 -size 22404 +oid sha256:445f824a8877befb2ccf69935785d7203331f31fd70925913e8ea91f5c234a48 +size 22324 diff --git a/rpmlint-tests.changes b/rpmlint-tests.changes index a8d1dd0..23ac0de 100644 --- a/rpmlint-tests.changes +++ b/rpmlint-tests.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Sep 29 12:06:57 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version master: + * Flake8 fixes + * Properly anchor systemd path checks + * Python 3.x porting + ------------------------------------------------------------------- Thu Sep 28 21:16:42 UTC 2017 - opensuse-packaging@opensuse.org diff --git a/rpmlint-tests.spec b/rpmlint-tests.spec index 645f111..2ab2ddc 100644 --- a/rpmlint-tests.spec +++ b/rpmlint-tests.spec @@ -23,7 +23,7 @@ BuildRequires: rpmlint-Factory-strict BuildRequires: rpmlint-mini Name: rpmlint-tests -Version: 84.87+git20170928.27b6cb3 +Version: 1.10 Release: 0 Summary: rpmlint regression tests License: SUSE-Public-Domain diff --git a/rpmlint.changes b/rpmlint.changes index 49cc396..752b5c9 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Sep 29 12:06:57 UTC 2017 - opensuse-packaging@opensuse.org + +- Update rpmlint-checks: + * Flake8 fixes + * Properly anchor systemd path checks + * Python 3.x porting + ------------------------------------------------------------------- Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com From 0f4f0a3c7e4f32f8e106c0f3d88efba30ba8423be10b1dd63a6cd57393067aec Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Fri, 29 Sep 2017 12:09:59 +0000 Subject: [PATCH 15/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=496 --- rpmlint-tests.changes | 8 -------- rpmlint-tests.spec | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/rpmlint-tests.changes b/rpmlint-tests.changes index 23ac0de..a8d1dd0 100644 --- a/rpmlint-tests.changes +++ b/rpmlint-tests.changes @@ -1,11 +1,3 @@ -------------------------------------------------------------------- -Fri Sep 29 12:06:57 UTC 2017 - opensuse-packaging@opensuse.org - -- Update to version master: - * Flake8 fixes - * Properly anchor systemd path checks - * Python 3.x porting - ------------------------------------------------------------------- Thu Sep 28 21:16:42 UTC 2017 - opensuse-packaging@opensuse.org diff --git a/rpmlint-tests.spec b/rpmlint-tests.spec index 2ab2ddc..645f111 100644 --- a/rpmlint-tests.spec +++ b/rpmlint-tests.spec @@ -23,7 +23,7 @@ BuildRequires: rpmlint-Factory-strict BuildRequires: rpmlint-mini Name: rpmlint-tests -Version: 1.10 +Version: 84.87+git20170928.27b6cb3 Release: 0 Summary: rpmlint regression tests License: SUSE-Public-Domain From 985e347c7a0ba1192ef496b862339be9c1c442ba9fab8d976f4c70fbfc778c83 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 07:51:17 +0000 Subject: [PATCH 16/34] - drop config.in: unused - switch to python 3.x OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=497 --- config | 376 ++++++++++++++++++------------------- config.in | 240 ----------------------- description-check.diff | 2 +- invalid-filerequires.diff | 2 +- libtool-wrapper-check.diff | 27 +-- rpmlint.changes | 2 + rpmlint.spec | 22 +-- 7 files changed, 209 insertions(+), 462 deletions(-) delete mode 100644 config.in diff --git a/config b/config index 08075e0..c13a60d 100644 --- a/config +++ b/config @@ -44,19 +44,19 @@ addCheck("TmpFilesCheck") addCheck("CheckSysVinitOnSystemd") # stuff autobuild takes care about -addFilter(".*invalid-version.*") -addFilter(".*invalid-packager.*") -addFilter(".*not-standard-release-extension.*") -#addFilter(".*non-standard-group.*") -addFilter(".*invalid-buildhost.*") -addFilter(".*executable-in-library-package.*") -addFilter(".*non-versioned-file-in-library-package.*") -addFilter(".*incoherent-version-in-name.*") -addFilter(".*invalid-vendor.*") -addFilter(".*invalid-distribution.*") -addFilter(".*hardcoded-path-in-buildroot-tag.*") -addFilter(".*no-buildroot-tag.*") -addFilter(".*cross-directory-hard-link.*") +addFilter('.*invalid-version.*') +addFilter('.*invalid-packager.*') +addFilter('.*not-standard-release-extension.*') +#addFilter('.*non-standard-group.*') +addFilter('.*invalid-buildhost.*') +addFilter('.*executable-in-library-package.*') +addFilter('.*non-versioned-file-in-library-package.*') +addFilter('.*incoherent-version-in-name.*') +addFilter('.*invalid-vendor.*') +addFilter('.*invalid-distribution.*') +addFilter('.*hardcoded-path-in-buildroot-tag.*') +addFilter('.*no-buildroot-tag.*') +addFilter('.*cross-directory-hard-link.*') # Configuration options used by the checks @@ -908,223 +908,223 @@ setOption("PAMModules.WhiteList", ( )) # Output filters -addFilter(".*spurious-bracket-in-.*") -addFilter(".*one-line-command-in-.*") -addFilter(" dir-or-file-in-opt ") # handled by CheckFilelist.py -addFilter(" dir-or-file-in-usr-local ") # handled by CheckFilelist.py -addFilter(" non-standard-dir-in-usr ") # handled by CheckFilelist.py -addFilter("incoherent-version-in-changelog") -addFilter(" no-signature") -addFilter(" symlink-crontab-file") #bnc591431 -addFilter(" without-chkconfig") -addFilter("unstripped-binary-or-object.*\.ko") -addFilter(" no-chkconfig") -addFilter(" subsys-not-used") -addFilter(" dangerous-command.*") -addFilter(" setuid-binary.*") -addFilter(".*FSSTND-dir-in-var /var/adm/.*") -addFilter("subdir-in-bin /sbin/conf.d/") -addFilter(".* nss_db non-standard-dir-in-var db") -addFilter("non-standard-dir-in-usr openwin") -addFilter("ibcs2 non-standard-dir-in-usr i486-sysv4") -addFilter("shlibs5 non-standard-dir-in-usr i486-linux-libc5") -addFilter("explicit-lib-dependency libtool") +addFilter(r'.*spurious-bracket-in-.*') +addFilter(r'.*one-line-command-in-.*') +addFilter(' dir-or-file-in-opt ') # handled by CheckFilelist.py +addFilter(' dir-or-file-in-usr-local ') # handled by CheckFilelist.py +addFilter(' non-standard-dir-in-usr ') # handled by CheckFilelist.py +addFilter('incoherent-version-in-changelog') +addFilter(' no-signature') +addFilter(' symlink-crontab-file') #bnc591431 +addFilter(' without-chkconfig') +addFilter(r'unstripped-binary-or-object.*\.ko') +addFilter(' no-chkconfig') +addFilter(' subsys-not-used') +addFilter(r' dangerous-command.*') +addFilter(r' setuid-binary.*') +addFilter(r'.*FSSTND-dir-in-var /var/adm/.*') +addFilter('subdir-in-bin /sbin/conf.d/') +addFilter(r'.* nss_db non-standard-dir-in-var db') +addFilter('non-standard-dir-in-usr openwin') +addFilter('ibcs2 non-standard-dir-in-usr i486-sysv4') +addFilter('shlibs5 non-standard-dir-in-usr i486-linux-libc5') +addFilter('explicit-lib-dependency libtool') # filesystem package needs special exceptions -addFilter("^filesystem\..*: dir-or-file-in-var-run") -addFilter("^filesystem\..*: dir-or-file-in-var-lock") -addFilter("^filesystem\..*: dir-or-file-in-var-tmp") -addFilter("^filesystem\..*: dir-or-file-in-var-run") -addFilter("^filesystem\..*: dir-or-file-in-var-lock") -addFilter("^filesystem\..*: dir-or-file-in-usr-tmp") -addFilter("^filesystem\..*: dir-or-file-in-tmp") -addFilter("^filesystem\..*: dir-or-file-in-mnt") -addFilter("^filesystem\..*: dir-or-file-in-home") -addFilter("^filesystem\..*: hidden-file-or-dir /root/.gnupg") -addFilter("^filesystem\..*: hidden-file-or-dir /root/.gnupg") -addFilter("^filesystem\..*: hidden-file-or-dir /etc/skel/.config") -addFilter("^filesystem\..*: hidden-file-or-dir /etc/skel/.local") -addFilter("^filesystem\..*: hidden-file-or-dir /tmp/.X11-unix") -addFilter("^filesystem\..*: hidden-file-or-dir /tmp/.ICE-unix") -addFilter("^filesystem\..*: hidden-file-or-dir /etc/skel/.fonts") -addFilter("^filesystem\..*: suse-filelist-forbidden-fhs23") -addFilter("^filesystem\..*: suse-filelist-forbidden-opt") -addFilter("^filesystem\..*: non-standard-uid /var/lib/nobody nobody") -addFilter("^filesystem\..*: missing-dependency-to-cron") +addFilter(r'^filesystem\..*: dir-or-file-in-var-run') +addFilter(r'^filesystem\..*: dir-or-file-in-var-lock') +addFilter(r'^filesystem\..*: dir-or-file-in-var-tmp') +addFilter(r'^filesystem\..*: dir-or-file-in-var-run') +addFilter(r'^filesystem\..*: dir-or-file-in-var-lock') +addFilter(r'^filesystem\..*: dir-or-file-in-usr-tmp') +addFilter(r'^filesystem\..*: dir-or-file-in-tmp') +addFilter(r'^filesystem\..*: dir-or-file-in-mnt') +addFilter(r'^filesystem\..*: dir-or-file-in-home') +addFilter(r'^filesystem\..*: hidden-file-or-dir /root/.gnupg') +addFilter(r'^filesystem\..*: hidden-file-or-dir /root/.gnupg') +addFilter(r'^filesystem\..*: hidden-file-or-dir /etc/skel/.config') +addFilter(r'^filesystem\..*: hidden-file-or-dir /etc/skel/.local') +addFilter(r'^filesystem\..*: hidden-file-or-dir /tmp/.X11-unix') +addFilter(r'^filesystem\..*: hidden-file-or-dir /tmp/.ICE-unix') +addFilter(r'^filesystem\..*: hidden-file-or-dir /etc/skel/.fonts') +addFilter(r'^filesystem\..*: suse-filelist-forbidden-fhs23') +addFilter(r'^filesystem\..*: suse-filelist-forbidden-opt') +addFilter(r'^filesystem\..*: non-standard-uid /var/lib/nobody nobody') +addFilter(r'^filesystem\..*: missing-dependency-to-cron') # has arch specific dirs in /usr -addFilter("^filesystem\..*: no-binary") +addFilter(r'^filesystem\..*: no-binary') # suppress any errors about internal packages -addFilter("^qa\S+: [EWI]:") -addFilter("^\S*(?:INTERNAL|internal)\.\S+: [EWI]:") +addFilter(r'^qa\S+: [EWI]:') +addFilter(r'^\S*(?:INTERNAL|internal)\.\S+: [EWI]:') # exceptions for devel-files -addFilter("devel-file-in-non-devel-package.*/boot/vmlinuz-.*autoconf.h") -addFilter("devel-file-in-non-devel-package.*/usr/src/linux-") -addFilter("devel-file-in-non-devel-package.*/usr/share/systemtap") -addFilter("kde4-kapptemplate\.\S+:.*devel-file-in-non-devel-package") -addFilter("kdesdk3\.\S+:.*devel-file-in-non-devel-package") -addFilter("-(?:examples|doc)\.\S+: \w: devel-file-in-non-devel-package") -addFilter("java\S+-demo\.\S+: \w: devel-file-in-non-devel-package") -addFilter('avr-libc\.\S+: \w: devel-file-in-non-devel-package') -addFilter('dietlibc\.\S+ \w: devel-file-in-non-devel-package') -addFilter('cross-.*devel-file-in-non-devel-package') -addFilter('cmake.*devel-file-in-non-devel-package') -addFilter('gcc\d\d.*devel-file-in-non-devel-package') -addFilter('OpenOffice_org-sdk\.\S+: \w: devel-file-in-non-devel-package') -addFilter('wnn-sdk\.\S+: \w: devel-file-in-non-devel-package') -addFilter('ocaml\.\S+: \w: devel-file-in-non-devel-package') -addFilter('xorg-x11-server-sdk\.\S+: \w: devel-file-in-non-devel-package') -addFilter('linux-kernel-headers\.\S+: \w: devel-file-in-non-devel-package') -addFilter(' devel-file-in-non-devel-package.*-config') -addFilter('libtool\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'devel-file-in-non-devel-package.*/boot/vmlinuz-.*autoconf.h') +addFilter(r'devel-file-in-non-devel-package.*/usr/src/linux-') +addFilter(r'devel-file-in-non-devel-package.*/usr/share/systemtap') +addFilter(r'kde4-kapptemplate\.\S+:.*devel-file-in-non-devel-package') +addFilter(r'kdesdk3\.\S+:.*devel-file-in-non-devel-package') +addFilter(r'-(?:examples|doc)\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'java\S+-demo\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'avr-libc\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'dietlibc\.\S+ \w: devel-file-in-non-devel-package') +addFilter(r'cross-.*devel-file-in-non-devel-package') +addFilter(r'cmake.*devel-file-in-non-devel-package') +addFilter(r'gcc\d\d.*devel-file-in-non-devel-package') +addFilter(r'OpenOffice_org-sdk\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'wnn-sdk\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'ocaml\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'xorg-x11-server-sdk\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r'linux-kernel-headers\.\S+: \w: devel-file-in-non-devel-package') +addFilter(r' devel-file-in-non-devel-package.*-config') +addFilter(r'libtool\.\S+: \w: devel-file-in-non-devel-package') -addFilter('update-desktop-files\.\S+: \w: untranslated-desktop-file') -addFilter("sdb.* dangling-relative-symlink /usr/share/doc/sdb/.*/gifs ../gifs") -addFilter("kernel-modules-not-in-kernel-packages") +addFilter(r'update-desktop-files\.\S+: \w: untranslated-desktop-file') +addFilter(r'sdb.* dangling-relative-symlink /usr/share/doc/sdb/.*/gifs ../gifs') +addFilter('kernel-modules-not-in-kernel-packages') # SUSE kmp's don't need manual depmod (bnc#456048) -addFilter("module-without-depmod-postin") -addFilter("postin-with-wrong-depmod") -addFilter("module-without-depmod-postun") -addFilter("postun-with-wrong-depmod") +addFilter('module-without-depmod-postin') +addFilter('postin-with-wrong-depmod') +addFilter('module-without-depmod-postun') +addFilter('postun-with-wrong-depmod') # -addFilter("configure-without-libdir-spec") -addFilter("conffile-without-noreplace-flag /etc/init.d") -addFilter("use-of-RPM_SOURCE_DIR") -addFilter("use-tmp-in-") -addFilter("symlink-contains-up-and-down-segments /var/lib/named") -addFilter("no-ldconfig-symlink") -addFilter("aaa_base\.\S+: \w: use-of-home-in-%post") -addFilter("description-line-too-long") -addFilter("hardcoded-library-path") -# addFilter("incoherent-subsys") +addFilter('configure-without-libdir-spec') +addFilter('conffile-without-noreplace-flag /etc/init.d') +addFilter('use-of-RPM_SOURCE_DIR') +addFilter('use-tmp-in-') +addFilter('symlink-contains-up-and-down-segments /var/lib/named') +addFilter('no-ldconfig-symlink') +addFilter(r'aaa_base\.\S+: \w: use-of-home-in-%post') +addFilter('description-line-too-long') +addFilter('hardcoded-library-path') +# addFilter('incoherent-subsys') # doesn't seem to make sense -addFilter("invalid-ldconfig-symlink") -addFilter("invalid-soname") -addFilter("library-not-linked-against-libc") -addFilter("only-non-binary-in-usr-lib") -addFilter("outside-libdir-files") +addFilter('invalid-ldconfig-symlink') +addFilter('invalid-soname') +addFilter('library-not-linked-against-libc') +addFilter('only-non-binary-in-usr-lib') +addFilter('outside-libdir-files') # we want these files -addFilter(" perl-temp-file ") -addFilter(" hidden-file-or-dir .*/\.packlist") -addFilter(" hidden-file-or-dir .*/\.directory") -addFilter("perl-.*no-binary") -addFilter(" no-major-in-name ") +addFilter(' perl-temp-file ') +addFilter(r' hidden-file-or-dir .*/\.packlist') +addFilter(r' hidden-file-or-dir .*/\.directory') +addFilter(r'perl-.*no-binary') +addFilter(' no-major-in-name ') # we check for that already -addFilter("dangling-relative-symlink") -addFilter(" lib-package-without-%mklibname") -addFilter(" requires-on-release") -addFilter(" non-executable-script /etc/profile.d/") -addFilter(" non-executable-script /var/adm/fillup-templates/") -addFilter(" init-script-name-with-dot ") -addFilter('.* statically-linked-binary /sbin/ldconfig') -addFilter('.* statically-linked-binary /sbin/init') -addFilter('valgrind.* statically-linked-binary') -addFilter('ldconfig-post.*/ddiwrapper/wine/') -addFilter('glibc\.\S+: \w: statically-linked-binary /usr/sbin/glibc_post_upgrade') -addFilter(" symlink-should-be-relative ") -addFilter(" binary-or-shlib-defines-rpath .*ORIGIN") -addFilter("libzypp.*shlib-policy-name-error.*libzypp") -addFilter("libtool.*shlib-policy.*") +addFilter('dangling-relative-symlink') +addFilter(' lib-package-without-%mklibname') +addFilter(' requires-on-release') +addFilter(' non-executable-script /etc/profile.d/') +addFilter(' non-executable-script /var/adm/fillup-templates/') +addFilter(' init-script-name-with-dot ') +addFilter(r'.* statically-linked-binary /sbin/ldconfig') +addFilter(r'.* statically-linked-binary /sbin/init') +addFilter(r'valgrind.* statically-linked-binary') +addFilter(r'ldconfig-post.*/ddiwrapper/wine/') +addFilter(r'glibc\.\S+: \w: statically-linked-binary /usr/sbin/glibc_post_upgrade') +addFilter(' symlink-should-be-relative ') +addFilter(' binary-or-shlib-defines-rpath .*ORIGIN') +addFilter(r'libzypp.*shlib-policy-name-error.*libzypp') +addFilter(r'libtool.*shlib-policy.*') # stuff that is currently too noisy, but might become relevant in the future -addFilter(" prereq-use") -addFilter(" file-not-utf8") -addFilter(" tag-not-utf8") -addFilter(" setup-not-quiet") -addFilter(" no-cleaning-of-buildroot ") -addFilter(" mixed-use-of-spaces-and-tabs ") -addFilter(" prereq-use ") +addFilter(' prereq-use') +addFilter(' file-not-utf8') +addFilter(' tag-not-utf8') +addFilter(' setup-not-quiet') +addFilter(' no-cleaning-of-buildroot ') +addFilter(' mixed-use-of-spaces-and-tabs ') +addFilter(' prereq-use ') # an issue with OBS, works with autobuild -addFilter(" no-packager-tag") -addFilter(" unversioned-explicit-provides ") -addFilter(" unversioned-explicit-obsoletes ") -addFilter(" no-%clean-section") -addFilter(" service-default-enabled ") -addFilter(" non-standard-dir-perm ") -addFilter(" conffile-without-noreplace-flag ") -addFilter(" non-standard-executable-perm ") -addFilter(" jar-not-indexed ") -addFilter(" uncompressed-zip ") -addFilter(" %ifarch-applied-patch ") -addFilter(" read-error ") -addFilter(" init-script-without-chkconfig-postin ") -addFilter(" init-script-without-chkconfig-preun ") -addFilter(" postin-without-chkconfig ") -addFilter(" preun-without-chkconfig ") -addFilter(" no-dependency-on locales") -addFilter(" incoherent-version-in-name") -addFilter(" binary-or-shlib-defines-rpath") -addFilter(" executable-marked-as-config-file") -addFilter(" log-files-without-logrotate") -addFilter(" hardcoded-prefix-tag") -addFilter(" no-documentation") -addFilter(" multiple-specfiles") -addFilter(" apache2-naming-policy-not-applied") -addFilter(" no-default-runlevel ") -addFilter(" setgid-binary ") -addFilter(" non-readable ") -addFilter(" manpage-not-bzipped ") -addFilter(" postin-without-ghost-file-creation ") +addFilter(' no-packager-tag') +addFilter(' unversioned-explicit-provides ') +addFilter(' unversioned-explicit-obsoletes ') +addFilter(' no-%clean-section') +addFilter(' service-default-enabled ') +addFilter(' non-standard-dir-perm ') +addFilter(' conffile-without-noreplace-flag ') +addFilter(' non-standard-executable-perm ') +addFilter(' jar-not-indexed ') +addFilter(' uncompressed-zip ') +addFilter(' %ifarch-applied-patch ') +addFilter(' read-error ') +addFilter(' init-script-without-chkconfig-postin ') +addFilter(' init-script-without-chkconfig-preun ') +addFilter(' postin-without-chkconfig ') +addFilter(' preun-without-chkconfig ') +addFilter(' no-dependency-on locales') +addFilter(' incoherent-version-in-name') +addFilter(' binary-or-shlib-defines-rpath') +addFilter(' executable-marked-as-config-file') +addFilter(' log-files-without-logrotate') +addFilter(' hardcoded-prefix-tag') +addFilter(' no-documentation') +addFilter(' multiple-specfiles') +addFilter(' apache2-naming-policy-not-applied') +addFilter(' no-default-runlevel ') +addFilter(' setgid-binary ') +addFilter(' non-readable ') +addFilter(' manpage-not-bzipped ') +addFilter(' postin-without-ghost-file-creation ') # bug 287090 -addFilter(" file-in-usr-marked-as-conffile") -addFilter(" non-remote_fs-dependency.*/boot") +addFilter(' file-in-usr-marked-as-conffile') +addFilter(' non-remote_fs-dependency.*/boot') # exceptions for non-devel-buildrequires -addFilter(" non-devel-buildrequires apache2-mod_perl") -addFilter(" non-devel-buildrequires ksh") -addFilter(" non-devel-buildrequires perl") -addFilter(" non-devel-buildrequires php5") -addFilter(" non-devel-buildrequires postfix") -addFilter(" non-devel-buildrequires python") -addFilter(" non-devel-buildrequires ruby") -addFilter(" non-devel-buildrequires valgrind") -addFilter(" non-devel-buildrequires yasm") -addFilter(" non-devel-buildrequires tcl") +addFilter(' non-devel-buildrequires apache2-mod_perl') +addFilter(' non-devel-buildrequires ksh') +addFilter(' non-devel-buildrequires perl') +addFilter(' non-devel-buildrequires php5') +addFilter(' non-devel-buildrequires postfix') +addFilter(' non-devel-buildrequires python') +addFilter(' non-devel-buildrequires ruby') +addFilter(' non-devel-buildrequires valgrind') +addFilter(' non-devel-buildrequires yasm') +addFilter(' non-devel-buildrequires tcl') -addFilter("beagle-index\.\S+: \w: (non-devel|unnecessary)-buildrequires") -addFilter("collect-desktop-files\.\S+: \w: (non-devel|unnecessary)-buildrequires") -addFilter("installation-images\.\S+: \w: (non-devel|unnecessary)-buildrequires") +addFilter(r'beagle-index\.\S+: \w: (non-devel|unnecessary)-buildrequires') +addFilter(r'collect-desktop-files\.\S+: \w: (non-devel|unnecessary)-buildrequires') +addFilter(r'installation-images\.\S+: \w: (non-devel|unnecessary)-buildrequires') # exceptions for filelist checks -addFilter("nfs-client\.\S+: \w: suse-filelist-forbidden-backup-file /var/lib/nfs/sm.bak ") -addFilter("perl\.\S+: \w: suse-filelist-forbidden-perl-dir ") -addFilter("info\.\S+: \w: info-dir-file .*/usr/share/info/dir") +addFilter(r'nfs-client\.\S+: \w: suse-filelist-forbidden-backup-file /var/lib/nfs/sm.bak ') +addFilter(r'perl\.\S+: \w: suse-filelist-forbidden-perl-dir ') +addFilter(r'info\.\S+: \w: info-dir-file .*/usr/share/info/dir') # fillup is known to break SuSEfirewall's sysconfig file on many # systems as people tend to break up long lines into several ones. # This bug remains unfixed since years (bnc#340926). # So we have to avoid fillup and therefore break the SUSE policy -addFilter("SuSEfirewall2\.\S+: \w: suse-filelist-forbidden-sysconfig.*/etc/sysconfig/SuSEfirewall2") +addFilter(r'SuSEfirewall2\.\S+: \w: suse-filelist-forbidden-sysconfig.*/etc/sysconfig/SuSEfirewall2') # these packages are used for CD creation and are not supposed to be # installed. It's still a dirty hack to make an exception. The # packages should either be built in a separate project with # different config or file be put somewhere below /opt/suse/* -addFilter("(?:dosutils|skelcd|installation-images|yast2-slide-show|instlux|skelcd-.*|patterns-.*)\.\S+: \w: suse-filelist-forbidden-fhs23 /CD1") +addFilter(r'(?:dosutils|skelcd|installation-images|yast2-slide-show|instlux|skelcd-.*|patterns-.*)\.\S+: \w: suse-filelist-forbidden-fhs23 /CD1') # suboptimal library packaging -addFilter(" non-devel-buildrequires graphviz") -addFilter(" non-devel-buildrequires ImageMagick") -addFilter(" non-devel-buildrequires aspell") -addFilter(" non-devel-buildrequires autotrace") -addFilter(" non-devel-buildrequires gettext") -addFilter(" non-devel-buildrequires devhelp") -addFilter(" non-devel-buildrequires libxml2") -addFilter(" non-devel-buildrequires libxslt") -addFilter(" non-devel-buildrequires recode") +addFilter(' non-devel-buildrequires graphviz') +addFilter(' non-devel-buildrequires ImageMagick') +addFilter(' non-devel-buildrequires aspell') +addFilter(' non-devel-buildrequires autotrace') +addFilter(' non-devel-buildrequires gettext') +addFilter(' non-devel-buildrequires devhelp') +addFilter(' non-devel-buildrequires libxml2') +addFilter(' non-devel-buildrequires libxslt') +addFilter(' non-devel-buildrequires recode') # many places have shorter paths -addFilter(" non-coherent-filename ") +addFilter(' non-coherent-filename ') # mandriva specific stuff that we don't want -addFilter(" invalid-build-requires ") -addFilter(" no-provides ") +addFilter(' invalid-build-requires ') +addFilter(' no-provides ') # bash completion files are not scripts, do not require them marked as %config -addFilter("W: non-conffile-in-etc /etc/bash_completion.d/") +addFilter('W: non-conffile-in-etc /etc/bash_completion.d/') # config ends here diff --git a/config.in b/config.in deleted file mode 100644 index 90c468a..0000000 --- a/config.in +++ /dev/null @@ -1,240 +0,0 @@ -# -*- python -*- -# Configuration for the rpmlint utility. -# Loaded before ~/.rpmlintrc -# $Id: config,v 1.39 2003/12/22 11:20:55 flepied Exp $ - -# This line is mandatory to access the configuration functions -from Config import * - -# Additionale path to look for checks - -#addCheckDir("~/mandrake/rpmlint") - -# Configure the checks if you don't want the default ones - -allChecks() - -addCheck("CheckBuildRoot") -addCheck("CheckExecDocs") -addCheck("CheckPkgConfig") -addCheck("CheckCommonFiles") -addCheck("CheckInitScripts") -addCheck("DuplicatesCheck") -addCheck("LibraryPolicyCheck") -addCheck("CheckIconSizes") -#addCheck("CheckStaticLibraries") -addCheck("BrandingPolicyCheck") -addCheck("CheckSUIDPermissions") -# polkit-default-privs would need to be installed always -#addCheck("CheckPolkitPrivs") -addCheck("CheckDBUSServices") -addCheck("CheckDBusPolicy") -addCheck("CheckFilelist") - -# stuff autobuild takes care about -addFilter(".*invalid-version.*") -addFilter(".*invalid-packager.*") -addFilter(".*not-standard-release-extension.*") -#addFilter(".*non-standard-group.*") -addFilter(".*invalid-buildhost.*") -addFilter(".*executable-in-library-package.*") -addFilter(".*non-versioned-file-in-library-package.*") -addFilter(".*incoherent-version-in-name.*") -addFilter(".*invalid-vendor.*") -addFilter(".*invalid-distribution.*") - -# Configuration options used by the checks - -#setOption("Vendor", "MySelf") -#setOption("Distribution", "MyDistrib") -setOption("UseBzip2", 0) -setOption("UseUTF8", 1) -#setOption("ReleaseExtension", None) -#setOption("ValidGroups", ("Group1", "Group2")) -#setOption("KernelModuleRPMsOK", 0) - -@STDGROUPS@ -@STDUSERS@ - -setOption('DanglingSymlinkExceptions', - (['/usr/share/doc/licenses/', 'licenses'], - ['consolehelper$', 'usermode-consoleonly'], -)) - -# Output filters -addFilter(".*spurious-bracket-in-.*") -addFilter(".*one-line-command-in-.*") -addFilter(" dir-or-file-in-opt") -addFilter("incoherent-version-in-changelog") -addFilter(" no-signature") -addFilter(" without-chkconfig") -addFilter("unstripped-binary-or-object.*\.ko") -addFilter(" no-chkconfig") -addFilter(" subsys-not-used") -addFilter(" dangerous-command.*") -addFilter(" setuid-binary.*") -addFilter(".*FSSTND-dir-in-var /var/adm/.*") -addFilter("no-url-tag") -addFilter("subdir-in-bin /sbin/conf.d/") -addFilter(" invalid-license") -addFilter(".* nss_db non-standard-dir-in-var db") -addFilter("non-standard-dir-in-usr openwin") -addFilter("ibcs2 non-standard-dir-in-usr i486-sysv4") -addFilter("shlibs5 non-standard-dir-in-usr i486-linux-libc5") -addFilter("filesystem dir-or-file") -addFilter("filesystem hidden-") -addFilter("explicit-lib-dependency libtool") - - -# suppress any errors about internal packages -addFilter("^qa\S+: [EWI]:") -addFilter("^\S*(?:INTERNAL|internal)\.\S+: [EWI]:") - - -# exceptions for devel-files -addFilter("devel-file-in-non-devel-package.*/boot/vmlinuz-.*autoconf.h") -addFilter("devel-file-in-non-devel-package.*/usr/src/linux-") -addFilter("devel-file-in-non-devel-package.*/usr/share/systemtap") -addFilter("kde4-kapptemplate\.\S+:.*devel-file-in-non-devel-package") -addFilter("kdesdk3\.\S+:.*devel-file-in-non-devel-package") -addFilter("-(?:examples|doc)\.\S+: \w: devel-file-in-non-devel-package") -addFilter("java\S+-demo\.\S+: \w: devel-file-in-non-devel-package") -addFilter('avr-libc\.\S+: \w: devel-file-in-non-devel-package') -addFilter('dietlibc\.\S+ \w: devel-file-in-non-devel-package') -addFilter('cross-.*devel-file-in-non-devel-package') -addFilter('cmake.*devel-file-in-non-devel-package') -addFilter('gcc\d\d.*devel-file-in-non-devel-package') -addFilter('OpenOffice_org-sdk\.\S+: \w: devel-file-in-non-devel-package') -addFilter('wnn-sdk\.\S+: \w: devel-file-in-non-devel-package') -addFilter('ocaml\.\S+: \w: devel-file-in-non-devel-package') -addFilter('xorg-x11-server-sdk\.\S+: \w: devel-file-in-non-devel-package') -addFilter('linux-kernel-headers\.\S+: \w: devel-file-in-non-devel-package') -addFilter(' devel-file-in-non-devel-package.*-config') -addFilter('libtool\.\S+: \w: devel-file-in-non-devel-package') - -addFilter('update-desktop-files\.\S+: \w: untranslated-desktop-file') -addFilter("sdb.* dangling-relative-symlink /usr/share/doc/sdb/.*/gifs ../gifs") -addFilter("kernel-modules-not-in-kernel-packages") -# SUSE kmp's don't need manual depmod (bnc#456048) -addFilter("module-without-depmod-postin") -addFilter("postin-with-wrong-depmod") -addFilter("module-without-depmod-postun") -addFilter("postun-with-wrong-depmod") -# -addFilter("configure-without-libdir-spec") -addFilter("conffile-without-noreplace-flag /etc/init.d") -addFilter("use-of-RPM_SOURCE_DIR") -addFilter(" info info-dir-file /usr/share/info/dir") -addFilter("use-tmp-in-") -addFilter("symlink-contains-up-and-down-segments /var/lib/named") -addFilter("no-ldconfig-symlink") -addFilter("aaa_base\.\S+: \w: use-of-home-in-%post") -addFilter("description-line-too-long") -addFilter("hardcoded-library-path") -# addFilter("incoherent-subsys") -# doesn't seem to make sense -addFilter("invalid-ldconfig-symlink") -addFilter("invalid-soname") -addFilter("library-not-linked-against-libc") -addFilter("only-non-binary-in-usr-lib") -addFilter("outside-libdir-files") -# we want these files -addFilter(" perl-temp-file ") -addFilter(" hidden-file-or-dir .*/\.packlist") -addFilter(" hidden-file-or-dir .*/\.directory") -addFilter("perl-.*no-binary") -addFilter(" no-major-in-name ") -# we check for that already -addFilter("dangling-relative-symlink") -addFilter(" lib-package-without-%mklibname") -addFilter(" requires-on-release") -addFilter(" non-executable-script /etc/profile.d/") -addFilter(" non-executable-script /var/adm/fillup-templates/") -addFilter(" init-script-name-with-dot ") -addFilter('.* statically-linked-binary /sbin/ldconfig') -addFilter('.* statically-linked-binary /sbin/init') -addFilter('ldconfig-post.*/ddiwrapper/wine/') -addFilter('glibc\.\S+: \w: statically-linked-binary /usr/sbin/glibc_post_upgrade') -addFilter(" symlink-should-be-relative ") -addFilter(" binary-or-shlib-defines-rpath .*ORIGIN") -addFilter("libzypp.*shlib-policy-name-error.*libzypp") - -# stuff that is currently too noisy, but might become relevant in the future -addFilter(" file-not-utf8") -addFilter(" tag-not-utf8") -addFilter(" setup-not-quiet") -addFilter(" no-cleaning-of-buildroot ") -addFilter(" mixed-use-of-spaces-and-tabs ") -addFilter(" prereq-use ") -addFilter(" unversioned-explicit-provides ") -addFilter(" unversioned-explicit-obsoletes ") -addFilter(" no-%clean-section") -addFilter(" service-default-enabled ") -addFilter(" non-standard-dir-perm ") -addFilter(" conffile-without-noreplace-flag ") -addFilter(" non-standard-executable-perm ") -addFilter(" jar-not-indexed ") -addFilter(" non-conffile-in-etc ") -addFilter(" uncompressed-zip ") -addFilter(" %ifarch-applied-patch ") -addFilter(" read-error ") -addFilter(" init-script-without-chkconfig-postin ") -addFilter(" init-script-without-chkconfig-preun ") -addFilter(" postin-without-chkconfig ") -addFilter(" preun-without-chkconfig ") -addFilter(" no-dependency-on locales") -addFilter(" incoherent-version-in-name") -addFilter(" binary-or-shlib-defines-rpath") -addFilter(" executable-marked-as-config-file") -addFilter(" log-files-without-logrotate") -addFilter(" hardcoded-prefix-tag") -addFilter(" no-documentation") -addFilter(" multiple-specfiles") -addFilter(" apache2-naming-policy-not-applied") -addFilter(" no-default-runlevel ") -addFilter(" setgid-binary ") -addFilter(" non-standard-gid ") -addFilter(" non-readable ") -addFilter(" manpage-not-bzipped ") -addFilter(" postin-without-ghost-file-creation ") -# bug 287090 -addFilter(" file-in-usr-marked-as-conffile") -addFilter(" non-remote_fs-dependency.*/boot") - -# exceptions for non-devel-buildrequires -addFilter(" non-devel-buildrequires apache2-mod_perl") -addFilter(" non-devel-buildrequires ksh") -addFilter(" non-devel-buildrequires perl") -addFilter(" non-devel-buildrequires php5") -addFilter(" non-devel-buildrequires postfix") -addFilter(" non-devel-buildrequires python") -addFilter(" non-devel-buildrequires ruby") -addFilter(" non-devel-buildrequires valgrind") -addFilter(" non-devel-buildrequires yasm") -addFilter(" non-devel-buildrequires tcl") - -addFilter("beagle-index\.\S+: \w: (non-devel|unnecessary)-buildrequires") -addFilter("collect-desktop-files\.\S+: \w: (non-devel|unnecessary)-buildrequires") -addFilter("installation-images\.\S+: \w: (non-devel|unnecessary)-buildrequires") - -# suboptimal library packaging -addFilter(" non-devel-buildrequires graphviz") -addFilter(" non-devel-buildrequires ImageMagick") -addFilter(" non-devel-buildrequires aspell") -addFilter(" non-devel-buildrequires autotrace") -addFilter(" non-devel-buildrequires gettext") -addFilter(" non-devel-buildrequires devhelp") -addFilter(" non-devel-buildrequires libxml2") -addFilter(" non-devel-buildrequires libxslt") -addFilter(" non-devel-buildrequires recode") - - -# many places have shorter paths -addFilter(" non-coherent-filename ") - -# mandriva specific stuff that we don't want -addFilter(" invalid-build-requires ") -addFilter(" no-provides ") - -# config ends here - diff --git a/description-check.diff b/description-check.diff index 3e51b92..1c1df4e 100644 --- a/description-check.diff +++ b/description-check.diff @@ -16,7 +16,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py 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]): ++ 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') diff --git a/invalid-filerequires.diff b/invalid-filerequires.diff index e3ac63b..4707c2d 100644 --- a/invalid-filerequires.diff +++ b/invalid-filerequires.diff @@ -15,7 +15,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py # () 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')) -+valid_filedep_regex=re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)') ++valid_filedep_regex = re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)') use_epoch = Config.getOption('UseEpoch', False) use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) max_line_len = Config.getOption('MaxLineLength', 79) diff --git a/libtool-wrapper-check.diff b/libtool-wrapper-check.diff index e0141b0..0c4fe5a 100644 --- a/libtool-wrapper-check.diff +++ b/libtool-wrapper-check.diff @@ -1,17 +1,6 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:39 +0200 -Subject: [PATCH] libtool-wrapper-check.diff - -=================================================================== ---- - BinariesCheck.py | 20 ++++++++++++++++++++ - 1 file changed, 20 insertions(+) - -Index: rpmlint-rpmlint-1.10/BinariesCheck.py -=================================================================== --- rpmlint-rpmlint-1.10.orig/BinariesCheck.py +++ rpmlint-rpmlint-1.10/BinariesCheck.py -@@ -367,8 +367,19 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -367,8 +367,15 @@ 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 @@ -19,26 +8,22 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py is_binary = is_elf or is_ar or is_ocaml_native or is_lua_bytecode + if is_shell: -+ count= 0 -+ for l in open(pkgfile.path, 'rb'): -+ count = count + 1 -+ if (l.find(b'This wrapper script should never be moved out of the build directory') != -1): ++ with open(pkgfile.path, 'rb') as inputf: ++ if (b'This wrapper script should never ' ++ b'be moved out of the build directory' in inputf.read(2048)): + printError(pkg, 'libtool-wrapper-in-package', fname) -+ break -+ if (count > 20): -+ break; + if not is_binary: if reference_regex.search(fname): lines = pkg.grep(invalid_dir_ref_regex, fname) -@@ -637,6 +648,15 @@ to list code compiled without -fPIC. +@@ -637,6 +644,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· ++run + +libtool --mode=install install -m perm + diff --git a/rpmlint.changes b/rpmlint.changes index 752b5c9..5cb0d0d 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -82,6 +82,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, 0001-Execute-chroot-tests-also-on-x86-rpms.patch, ignore-readelf-ar-error.diff +- drop config.in: unused +- switch to python 3.x ------------------------------------------------------------------- Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com diff --git a/rpmlint.spec b/rpmlint.spec index e72913b..12461a3 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -20,10 +20,9 @@ Name: rpmlint BuildRequires: obs-service-format_spec_file -BuildRequires: python-pytest BuildRequires: python3-flake8 +BuildRequires: python3-pytest BuildRequires: python3-rpm -BuildRequires: rpm-python BuildRequires: xz Summary: Rpm correctness checker License: GPL-2.0+ @@ -33,7 +32,6 @@ Release: 0 Source0: https://github.com/rpm-software-management/rpmlint/archive/rpmlint-%{version}.tar.gz Source1: rpmlint-checks-master.tar.xz Source2: config -Source3: config.in Source11: pie.config Source12: licenses.config Source99: README.packaging.txt @@ -47,10 +45,9 @@ Requires: dash Requires: desktop-file-utils Requires: file Requires: findutils -Requires: python-magic -Requires: python-pybeam -Requires: python-xml -Requires: rpm-python +Requires: python3-magic +Requires: python3-pybeam +Requires: python3-rpm Patch00: rpmlint-suse.diff Patch01: suse-checks.diff Patch02: suse-version.diff @@ -117,16 +114,19 @@ chmod 0755 rpmlint-checks-master/*.py mv rpmlint-checks-master/*.py . %build -make %{?_smp_mflags} +make %{?_smp_mflags} PYTHON=/usr/bin/python3 %install -make install DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT PYTHON=/usr/bin/python3 # the provided bash-completion does not work and only prints bash errors rm -rf $RPM_BUILD_ROOT/etc/bash_completion.d mv $RPM_BUILD_ROOT/etc/rpmlint/config $RPM_BUILD_ROOT/usr/share/rpmlint/config head -n 8 $RPM_BUILD_ROOT/usr/share/rpmlint/config > $RPM_BUILD_ROOT/etc/rpmlint/config # make sure that the package is sane -python -tt %{SOURCE100} $RPM_BUILD_ROOT/usr/share/rpmlint/*.py $RPM_BUILD_ROOT/usr/share/rpmlint/config +for f in $RPM_BUILD_ROOT/usr/share/rpmlint/*.py $RPM_BUILD_ROOT/usr/share/rpmlint/config; do + echo $f + env LC_ALL=C.utf8 python3 -tt %{SOURCE100} $f +done %__install -m 644 %{SOURCE11} %{buildroot}/%{_sysconfdir}/rpmlint/ cp %{SOURCE12} licenses.config @@ -137,7 +137,7 @@ done %__install -m 644 licenses.config %{buildroot}/%{_sysconfdir}/rpmlint/ %check -sh ./test.sh +env PYTHON=/usr/bin/python3 ./test.sh %files %defattr(-,root,root,0755) From b2de5e99aefe84c0249e9d4a47c97183f964adc0a4f2a84061a9a7e4ec147c81 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 07:54:06 +0000 Subject: [PATCH 17/34] - Update to version master: * Stop leaking filedescriptors * Address various deprecation warnings OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=498 --- _servicedata | 2 +- rpmlint-checks-master.tar.xz | 4 ++-- rpmlint.changes | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/_servicedata b/_servicedata index 18d2add..415bf86 100644 --- a/_servicedata +++ b/_servicedata @@ -3,4 +3,4 @@ http://github.com/openSUSE/rpmlint-tests.git 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 http://github.com/openSUSE/rpmlint-checks.git - 25f3752a0a5e8ab95aedee8504afddfe8d9b7e51 \ No newline at end of file + 3131f769085523c453232e07fd6827698064c68f \ No newline at end of file diff --git a/rpmlint-checks-master.tar.xz b/rpmlint-checks-master.tar.xz index ec8a4bf..950b7fd 100644 --- a/rpmlint-checks-master.tar.xz +++ b/rpmlint-checks-master.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:445f824a8877befb2ccf69935785d7203331f31fd70925913e8ea91f5c234a48 -size 22324 +oid sha256:f16222b4d4e129fddec7ea32970867406516ad57fe7f0403462d6a7f2ef1d53d +size 22360 diff --git a/rpmlint.changes b/rpmlint.changes index 5cb0d0d..0902432 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Sat Sep 30 07:53:20 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version master: + * Stop leaking filedescriptors + * Address various deprecation warnings + ------------------------------------------------------------------- Fri Sep 29 12:06:57 UTC 2017 - opensuse-packaging@opensuse.org From 680daa4eb00273da9d99c1dee56f0e697ac56c806759e5b872b79f326f436d64 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 08:27:35 +0000 Subject: [PATCH 18/34] * Add TmpFilesCheck * Flake8 / Stop leaking filedescriptors - Update rpmlint-tests: * Stop leaking filedescriptors * Address various deprecation warnings * Avoid leaking fds and further Python 3.x porting - drop sourced-dirs.diff, fix-shared-library-matching.diff, suse-python-abi-check.diff, add-check-for-tmpfiles-created-at-r.diff: obsolete ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=499 --- _servicedata | 2 +- add-check-for-tmpfiles-created-at-r.diff | 168 ----------------------- invalid-filerequires.diff | 2 +- remove-ghostfile-checks.diff | 34 +++++ rpmlint-checks-master.tar.xz | 4 +- rpmlint-suse.diff | 14 +- rpmlint.changes | 21 +-- rpmlint.spec | 5 +- suse-binarieschecks.diff | 4 +- suse-pkg-config-check.diff | 13 +- suse-spdx-license-exceptions.patch | 4 +- suse-tests-without-badness.patch | 5 +- suse-version.diff | 2 +- usr-arch.diff | 2 +- 14 files changed, 60 insertions(+), 220 deletions(-) delete mode 100644 add-check-for-tmpfiles-created-at-r.diff create mode 100644 remove-ghostfile-checks.diff diff --git a/_servicedata b/_servicedata index 415bf86..8c21f21 100644 --- a/_servicedata +++ b/_servicedata @@ -3,4 +3,4 @@ http://github.com/openSUSE/rpmlint-tests.git 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 http://github.com/openSUSE/rpmlint-checks.git - 3131f769085523c453232e07fd6827698064c68f \ No newline at end of file + 3803f11cea43a4238b96c1a083c1582e5177c35b \ No newline at end of file diff --git a/add-check-for-tmpfiles-created-at-r.diff b/add-check-for-tmpfiles-created-at-r.diff deleted file mode 100644 index ade19ed..0000000 --- a/add-check-for-tmpfiles-created-at-r.diff +++ /dev/null @@ -1,168 +0,0 @@ -From: Ludwig Nussel -Date: Fri, 5 Sep 2014 12:53:40 +0200 -Subject: [PATCH] add check for tmpfiles created at runtime - -this check parses files in /usr/lib/tmpfiles.d and verifies that -entries that create files or directories are actually listed in -%files. - -The check also handles the ghost file check as rpmlint shouldn't -complain about ghost files handled by the tmpfiles mechanism. ---- - PostCheck.py | 18 --------- - TmpFilesCheck.py | 111 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 111 insertions(+), 18 deletions(-) - create mode 100644 TmpFilesCheck.py - -Index: rpmlint-rpmlint-1.10/PostCheck.py -=================================================================== ---- 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) - -- ghost_files = pkg.ghostFiles() -- if ghost_files: -- postin = pkg[rpm.RPMTAG_POSTIN] -- prein = pkg[rpm.RPMTAG_PREIN] -- for f in ghost_files: -- if f in pkg.missingOkFiles(): -- continue -- if not postin and not prein: -- printWarning(pkg, 'ghost-files-without-postin') -- if (not postin or f not in postin) and \ -- (not prein or f not in prein): -- printWarning(pkg, -- 'postin-without-ghost-file-creation', f) -- - def check_aux(self, pkg, files, prog, script, tag, prereq): - if script: - if prog: -@@ -195,10 +181,6 @@ class PostCheck(AbstractCheck.AbstractCh - check = PostCheck() - - # Add information about checks --addDetails( --'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): - addDetails( - 'one-line-command-in-%s' % scriptlet, -Index: rpmlint-rpmlint-1.10/TmpFilesCheck.py -=================================================================== ---- /dev/null -+++ rpmlint-rpmlint-1.10/TmpFilesCheck.py -@@ -0,0 +1,111 @@ -+# -*- coding: utf-8 -*- -+############################################################################# -+# File : TmpFilesCheck.py -+# Package : rpmlint -+# Author : Ludwig Nussel -+# Created on : Wed Sep 03 10:36 2014 -+# Purpose : Check systemd created tmpfiles are included in filelist -+############################################################################# -+ -+import os -+import re -+ -+from Filter import addDetails, printError, printWarning -+import AbstractCheck -+import Pkg -+import stat -+import rpm -+ -+class TmpFilesCheck(AbstractCheck.AbstractCheck): -+ '''Check systemd created tmpfiles are included in filelist''' -+ -+ def __init__(self): -+ AbstractCheck.AbstractCheck.__init__(self, "TmpFilesCheck") -+ self._spec_file = None -+ -+ def check(self, pkg): -+ if pkg.isSource(): -+ return -+ -+ # file names handled by systemd-tmpfiles -+ tmp_files = set() -+ postin = pkg[rpm.RPMTAG_POSTIN] -+ prein = pkg[rpm.RPMTAG_PREIN] -+ -+ # see tmpfiles.d(5) -+ interesting_types = ('f', 'F', 'w', 'd', 'D', 'p', 'L', 'c', 'b') -+ -+ for fn, pkgfile in pkg.files().items(): -+ if not fn.startswith('/usr/lib/tmpfiles.d/'): -+ continue -+ if not stat.S_ISREG(pkgfile.mode): -+ printWarning(pkg, "tmpfile-not-regular-file", fn) -+ continue -+ -+ pattern = re.compile(r'systemd-tmpfiles --create .*%s'%re.escape(fn)) -+ if (not postin or not pattern.search(postin)) and \ -+ (not prein or not pattern.search(prein)): -+ printWarning(pkg, -+ 'postin-without-tmpfile-creation', fn) -+ -+ for line in open(pkgfile.path): -+ # skip comments -+ line = line.split('#')[0].split('\n')[0] -+ line = line.lstrip() -+ if not len(line): -+ continue -+ line = re.split(r'\s+', line) -+ # format is -+ #Type Path Mode UID GID Age Argument -+ # we only need type and path -+ if len(line) < 3: -+ continue -+ t = line[0] -+ p = line[1] -+ if t.endswith('!'): -+ t = t[:-1] -+ if not t in interesting_types: -+ continue -+ -+ tmp_files.add(p) -+ -+ if not p in pkg.files(): -+ printWarning(pkg, "tmpfile-not-in-filelist", p) -+ continue -+ if not pkg.files()[p].is_ghost: -+ printWarning(pkg, "tmpfile-not-ghost", p) -+ -+ # now check remaining ghost files that are not already -+ # handled by systemd-tmpfiles -+ ghost_files = set(pkg.ghostFiles()) - tmp_files -+ if ghost_files: -+ for f in ghost_files: -+ if f in pkg.missingOkFiles(): -+ continue -+ if not postin and not prein: -+ printWarning(pkg, 'ghost-files-without-postin') -+ if (not postin or f not in postin) and \ -+ (not prein or f not in prein): -+ printWarning(pkg, -+ 'postin-without-ghost-file-creation', f) -+ -+ -+ -+check = TmpFilesCheck() -+ -+addDetails( -+'postin-without-ghost-file-creation', -+'''A file tagged as ghost is not created during %prein nor during %postin.''', -+'postin-without-tmpfile-creation', -+'''Please use the %tmpfiles_create macro in %post for each of your tmpfiles.d files''', -+'tmpfile-not-regular-file', -+'''files in tmpfiles.d need to be regular files''', # otherwise we won't open it :-) -+'tmpfile-not-in-filelist', -+'''please add the specified file to your %files section as %ghost so -+users can easily query who created the file, it gets uninstalled on -+package removal and finally other rpmlint checks see it''', -+'tmpfile-not-ghost', -+'''the specified file is not marked as %ghost although created at -+runtime via tmpfiles mechanism.''' -+) -+# vim: sw=4 et diff --git a/invalid-filerequires.diff b/invalid-filerequires.diff index 4707c2d..6c39f9d 100644 --- a/invalid-filerequires.diff +++ b/invalid-filerequires.diff @@ -15,7 +15,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py # () 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')) -+valid_filedep_regex = re.compile('(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)') ++valid_filedep_regex = re.compile(r'(?:/s?bin/|^/etc/|^/usr/lib/sendmail$)') use_epoch = Config.getOption('UseEpoch', False) use_utf8 = Config.getOption('UseUTF8', Config.USEUTF8_DEFAULT) max_line_len = Config.getOption('MaxLineLength', 79) diff --git a/remove-ghostfile-checks.diff b/remove-ghostfile-checks.diff new file mode 100644 index 0000000..9b4d37d --- /dev/null +++ b/remove-ghostfile-checks.diff @@ -0,0 +1,34 @@ +--- 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) + +- ghost_files = pkg.ghostFiles() +- if ghost_files: +- postin = pkg[rpm.RPMTAG_POSTIN] +- prein = pkg[rpm.RPMTAG_PREIN] +- for f in ghost_files: +- if f in pkg.missingOkFiles(): +- continue +- if not postin and not prein: +- printWarning(pkg, 'ghost-files-without-postin') +- if (not postin or f not in postin) and \ +- (not prein or f not in prein): +- printWarning(pkg, +- 'postin-without-ghost-file-creation', f) +- + def check_aux(self, pkg, files, prog, script, tag, prereq): + if script: + if prog: +@@ -195,10 +181,6 @@ class PostCheck(AbstractCheck.AbstractCh + check = PostCheck() + + # Add information about checks +-addDetails( +-'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): + addDetails( + 'one-line-command-in-%s' % scriptlet, diff --git a/rpmlint-checks-master.tar.xz b/rpmlint-checks-master.tar.xz index 950b7fd..94f97df 100644 --- a/rpmlint-checks-master.tar.xz +++ b/rpmlint-checks-master.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f16222b4d4e129fddec7ea32970867406516ad57fe7f0403462d6a7f2ef1d53d -size 22360 +oid sha256:8744139e880d6f294c6ac9879af99ab3cf7d1497e38d2a113b375d08334cfa6e +size 23208 diff --git a/rpmlint-suse.diff b/rpmlint-suse.diff index 12d73a0..5950d7e 100644 --- a/rpmlint-suse.diff +++ b/rpmlint-suse.diff @@ -1,15 +1,3 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:37 +0200 -Subject: [PATCH] rpmlint-suse.diff - -=================================================================== ---- - FilesCheck.py | 2 +- - I18NCheck.py | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -Index: rpmlint-rpmlint-1.10/FilesCheck.py -=================================================================== --- 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 @@ -30,7 +18,7 @@ Index: rpmlint-rpmlint-1.10/I18NCheck.py package_regex = re.compile('-(' + '|'.join(LANGUAGES) + ')$') -locale_regex = re.compile('^(/usr/share/locale/([^/]+))/') -+locale_regex = re.compile('^(/(usr|opt/kde3|opt/gnome)/share/locale/([^/]+))/') ++locale_regex = re.compile(r'^(/(usr|opt/kde3|opt/gnome)/share/locale/([^/]+))/') correct_subdir_regex = re.compile('^(([a-z][a-z]([a-z])?(_[A-Z][A-Z])?)([.@].*$)?)$') lc_messages_regex = re.compile('/usr/share/locale/([^/]+)/LC_MESSAGES/.*(mo|po)$') man_regex = re.compile('/usr(?:/share)?/man/([^/]+)/man[0-9n][^/]*/[^/]+$') diff --git a/rpmlint.changes b/rpmlint.changes index 0902432..bb2b2cf 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -1,17 +1,17 @@ ------------------------------------------------------------------- -Sat Sep 30 07:53:20 UTC 2017 - opensuse-packaging@opensuse.org - -- Update to version master: - * Stop leaking filedescriptors - * Address various deprecation warnings - -------------------------------------------------------------------- -Fri Sep 29 12:06:57 UTC 2017 - opensuse-packaging@opensuse.org +Fri Sep 29 12:06:57 UTC 2017 - dmueller@suse.com - Update rpmlint-checks: * Flake8 fixes * Properly anchor systemd path checks * Python 3.x porting + * Add TmpFilesCheck + * Flake8 / Stop leaking filedescriptors + +- Update rpmlint-tests: + * Stop leaking filedescriptors + * Address various deprecation warnings + * Avoid leaking fds and further Python 3.x porting ------------------------------------------------------------------- Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com @@ -82,13 +82,14 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com * test: Test for unexpected errors in default and C locales * Remove obsolete LC_ALL setting from Makefile - drop version-control-internal-file.diff, boo1027577-license_tag.patch: upstream -- drop sourced-dirs.diff, fix-shared-library-matching.diff, suse-python-abi-check.diff: obsolete +- drop sourced-dirs.diff, fix-shared-library-matching.diff, + suse-python-abi-check.diff, add-check-for-tmpfiles-created-at-r.diff: obsolete - drop suse-readd_terminator_in_regex.patch: merged into original patch - add suse-tests-without-badness.patch, 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch, 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, 0001-Execute-chroot-tests-also-on-x86-rpms.patch, - ignore-readelf-ar-error.diff + ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 12461a3..8441e28 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -48,6 +48,7 @@ Requires: findutils Requires: python3-magic Requires: python3-pybeam Requires: python3-rpm +Requires: python3-xml Patch00: rpmlint-suse.diff Patch01: suse-checks.diff Patch02: suse-version.diff @@ -90,7 +91,7 @@ Patch53: suse-manpages-for-rc-scripts.diff Patch54: suse-ignore-specfile-errors.diff Patch55: invalid-filerequires.diff Patch57: check-for-self-provides.diff -Patch58: add-check-for-tmpfiles-created-at-r.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 @@ -99,8 +100,6 @@ Patch70: rpmlint-all-pie.patch # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 BuildArch: noarch -%py_requires - %description Rpmlint is a tool to check common errors on rpm packages. Binary and source packages can be checked. diff --git a/suse-binarieschecks.diff b/suse-binarieschecks.diff index 8ced32e..27adb89 100644 --- a/suse-binarieschecks.diff +++ b/suse-binarieschecks.diff @@ -24,8 +24,8 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py chroot_call_regex = create_regexp_call('chroot') # 401eb8: e8 c3 f0 ff ff callq 400f80 objdump_call_regex = re.compile(br'callq?\s(.*)') -+ debuginfo_regex = re.compile('^\s+\[\s*\d+\]\s+\.debug_.*\s+') -+ symtab_regex = re.compile('^\s+\[\s*\d+\]\s+\.symtab\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") diff --git a/suse-pkg-config-check.diff b/suse-pkg-config-check.diff index c0665e3..5fdb60b 100644 --- a/suse-pkg-config-check.diff +++ b/suse-pkg-config-check.diff @@ -1,21 +1,10 @@ -From: Some One -Date: Thu, 9 Apr 2015 14:55:38 +0200 -Subject: [PATCH] suse-pkg-config-check.diff - -=================================================================== ---- - TagsCheck.py | 19 ++++++++++++++++++- - 1 file changed, 18 insertions(+), 1 deletion(-) - -Index: rpmlint-rpmlint-1.10/TagsCheck.py -=================================================================== --- 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 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+') -+pkg_config_regex = re.compile('^/usr/(?:lib\d*|share)/pkgconfig/') ++pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/') 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 diff --git a/suse-spdx-license-exceptions.patch b/suse-spdx-license-exceptions.patch index bd3b6ee..8397008 100644 --- a/suse-spdx-license-exceptions.patch +++ b/suse-spdx-license-exceptions.patch @@ -56,9 +56,9 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py changelog_version_regex = re.compile(r'[^>]([^ >]+)\s*$') @@ -418,6 +447,7 @@ lib_package_regex = re.compile(r'(?:^(?: leading_space_regex = re.compile(r'^\s+') - pkg_config_regex = re.compile('^/usr/(?:lib\d*|share)/pkgconfig/') + pkg_config_regex = re.compile(r'^/usr/(?:lib\d*|share)/pkgconfig/') license_regex = re.compile(r'\(([^)]+)\)|\s(?:and|or|AND|OR)\s') -+license_exception_regex = re.compile('(\S+)\sWITH\s(\S+)') ++license_exception_regex = re.compile(r'(\S+)\sWITH\s(\S+)') 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) diff --git a/suse-tests-without-badness.patch b/suse-tests-without-badness.patch index 6d8a801..64116b3 100644 --- a/suse-tests-without-badness.patch +++ b/suse-tests-without-badness.patch @@ -2,7 +2,7 @@ Index: rpmlint-rpmlint-1.10/test.sh =================================================================== --- rpmlint-rpmlint-1.10.orig/test.sh +++ rpmlint-rpmlint-1.10/test.sh -@@ -19,7 +19,13 @@ for i in $TESTPATH/test.*.py; do +@@ -19,7 +19,10 @@ for i in $TESTPATH/test.*.py; do fi done @@ -11,9 +11,6 @@ Index: rpmlint-rpmlint-1.10/test.sh + +run_rpmlint="$PYTHON ./rpmlint -f config -C $(pwd)" + -+echo "Removing Badness.." -+cp config config.backup -+sed -e "s,setOption(\"Badnes.*,," config echo "Check that rpmlint executes with no unexpected errors" echo "...in default locale" diff --git a/suse-version.diff b/suse-version.diff index 09da413..1f20fe5 100644 --- a/suse-version.diff +++ b/suse-version.diff @@ -15,7 +15,7 @@ Index: rpmlint-rpmlint-1.10/SpecCheck.py buildarch_regex = re_tag_compile('BuildArch(?:itectures)?') buildprereq_regex = re_tag_compile('BuildPreReq') prereq_regex = re_tag_compile(r'PreReq(\(.*\))') -+suse_version_regex = re.compile('%suse_version\s*[<>=]+\s*(\d+)') ++suse_version_regex = re.compile(r'%suse_version\s*[<>=]+\s*(\d+)') make_check_regex = re.compile(r'(^|\s|%{?__)make}?\s+(check|test)') rm_regex = re.compile(r'(^|\s)((.*/)?rm|%{?__rm}?) ') diff --git a/usr-arch.diff b/usr-arch.diff index b8f7cd6..0196656 100644 --- a/usr-arch.diff +++ b/usr-arch.diff @@ -15,7 +15,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py 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('/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64|m68k|arm|aarch64)') ++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): From 50e8456b251f68b9f0ac1018b5c825bdb4e05ed9522b62c0ffd00bd5510bcd81 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 14:55:07 +0000 Subject: [PATCH 19/34] ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff, fix-diag-sortorder.diff OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=500 --- fix-diag-sortorder.diff | 16 ++++++++++++++++ rpmlint.changes | 3 ++- rpmlint.spec | 1 + 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 fix-diag-sortorder.diff diff --git a/fix-diag-sortorder.diff b/fix-diag-sortorder.diff new file mode 100644 index 0000000..9d0ca54 --- /dev/null +++ b/fix-diag-sortorder.diff @@ -0,0 +1,16 @@ +diff --git a/Filter.py b/Filter.py +index a728115..87b4009 100644 +--- a/Filter.py ++++ b/Filter.py +@@ -111,8 +111,9 @@ def printDescriptions(reason): + + + def _diag_sortkey(x): +- xs = x.split() +- return (xs[2], xs[1]) ++ xs = x.split(maxsplit=2) ++ # ['game.x86_64:', 'W:', 'call-to-mktemp /usr/games/lib/blub\n'] ++ return (xs[2], xs[1], xs[0]) + + + def printAllReasons(): diff --git a/rpmlint.changes b/rpmlint.changes index bb2b2cf..db5292a 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -89,7 +89,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com 0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch, 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, 0001-Execute-chroot-tests-also-on-x86-rpms.patch, - ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff + ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff, + fix-diag-sortorder.diff - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 8441e28..94eae3a 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -96,6 +96,7 @@ 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 Patch70: rpmlint-all-pie.patch # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 BuildArch: noarch From 613f1d6bc014250df0f3f1200b2d6ed5278f2f33532954f930a13b850fbd9551 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 14:56:31 +0000 Subject: [PATCH 20/34] * Port LibraryPolicyCheck to Python 3.x OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=501 --- _service | 4 ++-- _servicedata | 2 +- rpmlint-checks-master.tar.xz | 4 ++-- rpmlint.changes | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/_service b/_service index 9915f6f..ce17181 100644 --- a/_service +++ b/_service @@ -2,14 +2,14 @@ 1 84.87+git%cd.%h - http://github.com/openSUSE/rpmlint-tests.git + https://github.com/openSUSE/rpmlint-tests.git git enable 1 master - http://github.com/openSUSE/rpmlint-checks.git + https://github.com/openSUSE/rpmlint-checks.git git enable diff --git a/_servicedata b/_servicedata index 8c21f21..a2a8142 100644 --- a/_servicedata +++ b/_servicedata @@ -3,4 +3,4 @@ http://github.com/openSUSE/rpmlint-tests.git 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 http://github.com/openSUSE/rpmlint-checks.git - 3803f11cea43a4238b96c1a083c1582e5177c35b \ No newline at end of file + b82179a9c8d48a3573e8c4f4770500d1fe932921 \ No newline at end of file diff --git a/rpmlint-checks-master.tar.xz b/rpmlint-checks-master.tar.xz index 94f97df..250d689 100644 --- a/rpmlint-checks-master.tar.xz +++ b/rpmlint-checks-master.tar.xz @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8744139e880d6f294c6ac9879af99ab3cf7d1497e38d2a113b375d08334cfa6e -size 23208 +oid sha256:9a0d1c0f84b777aa36e5f31dda97ce4cf4d803eb4f2d256edd75063c6e679bcb +size 23192 diff --git a/rpmlint.changes b/rpmlint.changes index db5292a..3970c5c 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -7,6 +7,7 @@ Fri Sep 29 12:06:57 UTC 2017 - dmueller@suse.com * Python 3.x porting * Add TmpFilesCheck * Flake8 / Stop leaking filedescriptors + * Port LibraryPolicyCheck to Python 3.x - Update rpmlint-tests: * Stop leaking filedescriptors From 1ce530fa60b478d6e5388895d744f5bdcd6ee5a3b53dc4ca62b4646aca7050ca Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 14:56:50 +0000 Subject: [PATCH 21/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=502 --- _servicedata | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/_servicedata b/_servicedata index a2a8142..a30c0ce 100644 --- a/_servicedata +++ b/_servicedata @@ -1,6 +1,6 @@ - http://github.com/openSUSE/rpmlint-tests.git + https://github.com/openSUSE/rpmlint-tests.git 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 - http://github.com/openSUSE/rpmlint-checks.git - b82179a9c8d48a3573e8c4f4770500d1fe932921 \ No newline at end of file + https://github.com/openSUSE/rpmlint-checks.git + b82179a9c8d48a3573e8c4f4770500d1fe932921 From 2d2af816d17acf3a99bab9c4d3ebbee8e890dd81c7e4e02c71a5561dbb7a73f8 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 15:19:04 +0000 Subject: [PATCH 22/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=503 --- fix-diag-sortorder.diff | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/fix-diag-sortorder.diff b/fix-diag-sortorder.diff index 9d0ca54..9585830 100644 --- a/fix-diag-sortorder.diff +++ b/fix-diag-sortorder.diff @@ -1,16 +1,43 @@ -diff --git a/Filter.py b/Filter.py -index a728115..87b4009 100644 --- a/Filter.py +++ b/Filter.py -@@ -111,8 +111,9 @@ def printDescriptions(reason): +@@ -43,15 +43,15 @@ else: + + + def printInfo(pkg, reason, *details): +- _print("I", pkg, reason, details) ++ _print('I', pkg, reason, details) + + + def printWarning(pkg, reason, *details): +- _print("W", pkg, reason, details) ++ _print('W', pkg, reason, details) + + + def printError(pkg, reason, *details): +- _print("E", pkg, reason, details) ++ _print('E', pkg, reason, details) + + + def _print(msgtype, pkg, reason, details): +@@ -111,8 +111,10 @@ def printDescriptions(reason): def _diag_sortkey(x): - xs = x.split() - return (xs[2], xs[1]) + xs = x.split(maxsplit=2) ++ # Primary Sort by Category: Info first, then Warnings, then Errors + # ['game.x86_64:', 'W:', 'call-to-mktemp /usr/games/lib/blub\n'] -+ return (xs[2], xs[1], xs[0]) ++ return (xs[2], str('IWE'.find(xs[1][0])), xs[0]) def printAllReasons(): +@@ -121,7 +123,7 @@ def printAllReasons(): + return False + + global _diagnostic +- _diagnostic.sort(key=_diag_sortkey, reverse=True) ++ _diagnostic.sort(key=_diag_sortkey) + last_reason = '' + for diag in _diagnostic: + if Config.info: From 3487f7c4e6bcda15740ed01e13768f52326d8003dd7b31e6fc1a25885b3fd735 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 15:52:45 +0000 Subject: [PATCH 23/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=504 --- fix-diag-sortorder.diff | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fix-diag-sortorder.diff b/fix-diag-sortorder.diff index 9585830..cb2951f 100644 --- a/fix-diag-sortorder.diff +++ b/fix-diag-sortorder.diff @@ -26,9 +26,9 @@ - xs = x.split() - return (xs[2], xs[1]) + xs = x.split(maxsplit=2) -+ # Primary Sort by Category: Info first, then Warnings, then Errors ++ # Sort Category (Info/Warnings/Errors), Diagnostic, Name + # ['game.x86_64:', 'W:', 'call-to-mktemp /usr/games/lib/blub\n'] -+ return (xs[2], str('IWE'.find(xs[1][0])), xs[0]) ++ return (str('IWE'.find(xs[1][0])), xs[2], xs[0]) def printAllReasons(): From 6358689fd4b716c13eef67345dcd5adbc163ba9331ea697ac5f6edc295316086 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 16:20:40 +0000 Subject: [PATCH 24/34] - Update to version 84.87+git20170930.921e051: * Update reference files against rpmlint 1.10 drop 0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch rpmlint-pie-factory.patch, rpmlint-pie-leap42.patch: this belongs into git OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=505 --- ...est-for-Leap-42.2-severity-reduction.patch | 29 ------ _servicedata | 4 +- rpmlint-pie-factory.patch | 26 ------ rpmlint-pie-leap42.patch | 88 ------------------- ...int-tests-84.87+git20170928.27b6cb3.tar.xz | 3 - ...int-tests-84.87+git20170930.921e051.tar.xz | 3 + rpmlint-tests.changes | 9 ++ rpmlint-tests.spec | 12 +-- 8 files changed, 15 insertions(+), 159 deletions(-) delete mode 100644 0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch delete mode 100644 rpmlint-pie-factory.patch delete mode 100644 rpmlint-pie-leap42.patch delete mode 100644 rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz create mode 100644 rpmlint-tests-84.87+git20170930.921e051.tar.xz diff --git a/0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch b/0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch deleted file mode 100644 index b5ec2fa..0000000 --- a/0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4565372c418433d3d8ff47e59924791f62a20b3a Mon Sep 17 00:00:00 2001 -From: Jimmy Berry -Date: Tue, 25 Oct 2016 13:27:06 -0500 -Subject: [PATCH 1/2] Update varrun test for Leap 42.2 severity reduction. - ---- - tests/varrun.ref | 12 ++++++------ - 1 file changed, 6 insertions(+), 6 deletions(-) - -diff --git a/tests/varrun.ref b/tests/varrun.ref -index 9982344..6b0d28a 100644 ---- a/tests/varrun.ref -+++ b/tests/varrun.ref -@@ -1,6 +1,6 @@ --varrun: E: non-ghost-in-run (Badness: 10000) /run/bar --varrun: E: non-ghost-in-run (Badness: 10000) /run/lock/foo --varrun: E: dir-or-file-in-var-run (Badness: 10000) /var/run --varrun: E: dir-or-file-in-var-run (Badness: 10000) /var/run/bar --varrun: E: dir-or-file-in-var-lock (Badness: 10000) /var/lock/foo --1 packages and 0 specfiles checked; 5 errors, 0 warnings. -+varrun: W: non-ghost-in-run /run/bar -+varrun: W: non-ghost-in-run /run/lock/foo -+varrun: W: dir-or-file-in-var-run /var/run -+varrun: W: dir-or-file-in-var-run /var/run/bar -+varrun: W: dir-or-file-in-var-lock /var/lock/foo -+1 packages and 0 specfiles checked; 0 errors, 5 warnings. --- -2.10.1 - diff --git a/_servicedata b/_servicedata index a30c0ce..c1c4721 100644 --- a/_servicedata +++ b/_servicedata @@ -1,6 +1,6 @@ https://github.com/openSUSE/rpmlint-tests.git - 27b6cb37e629d20ad4d7c0a590a73fbce5ae6009 + 921e05148f1f32a2ef1f31a5e646ed9b2b22c4e1 https://github.com/openSUSE/rpmlint-checks.git - b82179a9c8d48a3573e8c4f4770500d1fe932921 + b82179a9c8d48a3573e8c4f4770500d1fe932921 \ No newline at end of file diff --git a/rpmlint-pie-factory.patch b/rpmlint-pie-factory.patch deleted file mode 100644 index 8f363aa..0000000 --- a/rpmlint-pie-factory.patch +++ /dev/null @@ -1,26 +0,0 @@ -Index: rpmlint-tests-84.87+git20170418.092177d/tests/pie.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/pie.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/pie.ref -@@ -1,4 +1,5 @@ -+pie: W: position-independent-executable-suggested /usr/bin/telnet - pie: W: permissions-incorrect /bin/mount has mode 0755 but should be 04755 - pie: E: non-position-independent-executable (Badness: 10000) /usr/bin/telnet - pie: W: missing-call-to-setgroups-before-setuid /bin/mount --1 packages and 0 specfiles checked; 1 errors, 2 warnings. -+1 packages and 0 specfiles checked; 1 errors, 3 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/permissions1.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/permissions1.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/permissions1.ref -@@ -1,3 +1,4 @@ -+permissions1: W: position-independent-executable-suggested /bin/ls - permissions1: E: permissions-unauthorized-file (Badness: 10000) /etc/permissions.d/test - permissions1: W: permissions-missing-verifyscript missing %verify_permissions -e /bin/ls - permissions1: W: permissions-missing-verifyscript missing %verify_permissions -e /bin/su -@@ -8,4 +9,4 @@ permissions1: W: permissions-incorrect-o - permissions1: W: permissions-incorrect /bin/su has mode 0755 but should be 04755 - permissions1: E: permissions-file-setuid-bit (Badness: 10000) /bin/ls is packaged with setuid/setgid bits (04755) - permissions1: W: non-position-independent-executable /bin/ls --1 packages and 0 specfiles checked; 2 errors, 8 warnings. -+1 packages and 0 specfiles checked; 2 errors, 9 warnings. diff --git a/rpmlint-pie-leap42.patch b/rpmlint-pie-leap42.patch deleted file mode 100644 index 8d52a9f..0000000 --- a/rpmlint-pie-leap42.patch +++ /dev/null @@ -1,88 +0,0 @@ -Index: rpmlint-tests-84.87+git20170418.092177d/tests/srv.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/srv.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/srv.ref -@@ -1,4 +1,5 @@ - srv: E: suse-filelist-forbidden-srv (Badness: 10000) /usr/local/ftp is not allowed in SUSE - srv: W: suse-filelist-forbidden-fhs23 /usr/local is not allowed in FHS 2.3 -+srv: W: position-independent-executable-suggested /usr/local/ftp/foo - srv: W: call-to-mktemp /usr/local/ftp/foo --1 packages and 0 specfiles checked; 1 errors, 2 warnings. -+1 packages and 0 specfiles checked; 1 errors, 3 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/debug.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/debug.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/debug.ref -@@ -1,5 +1,6 @@ - debug: W: static-library-without-symtab /usr/lib/foo/t2.a - debug: W: static-library-without-debuginfo /usr/lib/foo/t.a -+debug: W: position-independent-executable-suggested /usr/bin/t - debug: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib/foo/t.a - debug: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib/foo/t2.a --1 packages and 0 specfiles checked; 2 errors, 2 warnings. -+1 packages and 0 specfiles checked; 2 errors, 3 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/game.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/game.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/game.ref -@@ -1,5 +1,7 @@ - game: E: suse-filelist-forbidden-games (Badness: 10000) /usr/games/lib/blub is not allowed in SUSE - game: E: suse-filelist-forbidden-games (Badness: 10000) /usr/games/lib is not allowed in SUSE -+game: W: position-independent-executable-suggested /usr/games/foo -+game: W: position-independent-executable-suggested /usr/games/lib/blub - game: W: call-to-mktemp /usr/games/foo - game: W: call-to-mktemp /usr/games/lib/blub --1 packages and 0 specfiles checked; 2 errors, 2 warnings. -+1 packages and 0 specfiles checked; 2 errors, 4 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/debug2.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/debug2.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/debug2.ref -@@ -1,4 +1,5 @@ - debug2: W: static-library-without-symtab /usr/lib/foo/t2.a -+debug2: W: position-independent-executable-suggested /usr/bin/t - debug2: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib/foo/t.a - debug2: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib/foo/t2.a --1 packages and 0 specfiles checked; 2 errors, 1 warnings. -+1 packages and 0 specfiles checked; 2 errors, 2 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/chroot.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/chroot.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/chroot.ref -@@ -1,2 +1,4 @@ -+chroot: W: position-independent-executable-suggested /usr/bin/call_chroot_with_chdir -+chroot: W: position-independent-executable-suggested /usr/bin/call_chroot - chroot: W: missing-call-to-chdir-with-chroot /usr/bin/call_chroot --1 packages and 0 specfiles checked; 0 errors, 1 warnings. -+1 packages and 0 specfiles checked; 0 errors, 3 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/debug1.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/debug1.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/debug1.ref -@@ -1,5 +1,6 @@ - debug1: W: static-library-without-symtab /usr/lib/foo/t2.a - debug1: W: static-library-without-debuginfo /usr/lib/foo/t.a -+debug1: W: position-independent-executable-suggested /usr/bin/t - debug1: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib/foo/t.a - debug1: E: devel-file-in-non-devel-package (Badness: 50) /usr/lib/foo/t2.a --1 packages and 0 specfiles checked; 2 errors, 2 warnings. -+1 packages and 0 specfiles checked; 2 errors, 3 warnings. -Index: rpmlint-tests-84.87+git20170418.092177d/tests/gethostbyname.ref -=================================================================== ---- rpmlint-tests-84.87+git20170418.092177d.orig/tests/gethostbyname.ref -+++ rpmlint-tests-84.87+git20170418.092177d/tests/gethostbyname.ref -@@ -1,7 +1,13 @@ -+gethostbyname: W: position-independent-executable-suggested /usr/bin/call_gethostbyaddr -+gethostbyname: W: position-independent-executable-suggested /usr/bin/call_gethostbyname2 -+gethostbyname: W: position-independent-executable-suggested /usr/bin/call_gethostbyname -+gethostbyname: W: position-independent-executable-suggested /usr/bin/call_gethostbyname2_r -+gethostbyname: W: position-independent-executable-suggested /usr/bin/call_gethostbyaddr_r -+gethostbyname: W: position-independent-executable-suggested /usr/bin/call_gethostbyname_r - gethostbyname: I: binary-or-shlib-calls-gethostbyname /usr/bin/call_gethostbyaddr - gethostbyname: I: binary-or-shlib-calls-gethostbyname /usr/bin/call_gethostbyname2 - gethostbyname: I: binary-or-shlib-calls-gethostbyname /usr/bin/call_gethostbyname - gethostbyname: I: binary-or-shlib-calls-gethostbyname /usr/bin/call_gethostbyname2_r - gethostbyname: I: binary-or-shlib-calls-gethostbyname /usr/bin/call_gethostbyaddr_r - gethostbyname: I: binary-or-shlib-calls-gethostbyname /usr/bin/call_gethostbyname_r --1 packages and 0 specfiles checked; 0 errors, 0 warnings. -+1 packages and 0 specfiles checked; 0 errors, 6 warnings. diff --git a/rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz b/rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz deleted file mode 100644 index e506e69..0000000 --- a/rpmlint-tests-84.87+git20170928.27b6cb3.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1ee29044ba89b88fb014a1c09760cbda60f210f63225c0a4a778f59d5eba7622 -size 11192 diff --git a/rpmlint-tests-84.87+git20170930.921e051.tar.xz b/rpmlint-tests-84.87+git20170930.921e051.tar.xz new file mode 100644 index 0000000..b37e3d7 --- /dev/null +++ b/rpmlint-tests-84.87+git20170930.921e051.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:736b97e6b2b1568a63b432f68a0db15ba37c3f856c13fdcbbc031d2ce2690406 +size 11212 diff --git a/rpmlint-tests.changes b/rpmlint-tests.changes index a8d1dd0..508bc7a 100644 --- a/rpmlint-tests.changes +++ b/rpmlint-tests.changes @@ -1,8 +1,17 @@ +------------------------------------------------------------------- +Sat Sep 30 16:19:07 UTC 2017 - opensuse-packaging@opensuse.org + +- Update to version 84.87+git20170930.921e051: + * Update reference files against rpmlint 1.10 + ------------------------------------------------------------------- Thu Sep 28 21:16:42 UTC 2017 - opensuse-packaging@opensuse.org - Update to version 84.87+git20170928.27b6cb3: * Adjustments for newer rpmlint + drop 0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch + rpmlint-pie-factory.patch, rpmlint-pie-leap42.patch: + this belongs into git ------------------------------------------------------------------- Thu Sep 28 12:47:02 UTC 2017 - opensuse-packaging@opensuse.org diff --git a/rpmlint-tests.spec b/rpmlint-tests.spec index 645f111..88f3d30 100644 --- a/rpmlint-tests.spec +++ b/rpmlint-tests.spec @@ -23,7 +23,7 @@ BuildRequires: rpmlint-Factory-strict BuildRequires: rpmlint-mini Name: rpmlint-tests -Version: 84.87+git20170928.27b6cb3 +Version: 84.87+git20170930.921e051 Release: 0 Summary: rpmlint regression tests License: SUSE-Public-Domain @@ -31,9 +31,6 @@ Group: Development/Tools/Building BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: http://www.opensuse.org/ Source: rpmlint-tests-%version.tar.xz -Patch1: 0001-Update-varrun-test-for-Leap-42.2-severity-reduction.patch -Patch2: rpmlint-pie-leap42.patch -Patch3: rpmlint-pie-factory.patch %description This package doesn't actually contain any files and is not meant to @@ -42,13 +39,6 @@ regression tests against rpmlint(-mini). %prep %setup -q -%if 0%{?sle_version} >= 120200 -%patch1 -p1 -%endif -%if 0%{?suse_version} < 1330 -%patch2 -p1 -%endif -%patch3 -p1 %build mkdir rpms From 070235a841dfe57cd9b87481a28a13d76c81458ea018ded63b38daaec3206291 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 16:38:21 +0000 Subject: [PATCH 25/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=506 --- _servicedata | 2 +- rpmlint-tests-84.87+git20170930.921e051.tar.xz | 3 --- rpmlint-tests-84.87+git20170930.a05216c.tar.xz | 3 +++ rpmlint-tests.spec | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) delete mode 100644 rpmlint-tests-84.87+git20170930.921e051.tar.xz create mode 100644 rpmlint-tests-84.87+git20170930.a05216c.tar.xz diff --git a/_servicedata b/_servicedata index c1c4721..bf4f10f 100644 --- a/_servicedata +++ b/_servicedata @@ -1,6 +1,6 @@ https://github.com/openSUSE/rpmlint-tests.git - 921e05148f1f32a2ef1f31a5e646ed9b2b22c4e1 + a05216ca4502eb1c029f68534ada12092e139999 https://github.com/openSUSE/rpmlint-checks.git b82179a9c8d48a3573e8c4f4770500d1fe932921 \ No newline at end of file diff --git a/rpmlint-tests-84.87+git20170930.921e051.tar.xz b/rpmlint-tests-84.87+git20170930.921e051.tar.xz deleted file mode 100644 index b37e3d7..0000000 --- a/rpmlint-tests-84.87+git20170930.921e051.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:736b97e6b2b1568a63b432f68a0db15ba37c3f856c13fdcbbc031d2ce2690406 -size 11212 diff --git a/rpmlint-tests-84.87+git20170930.a05216c.tar.xz b/rpmlint-tests-84.87+git20170930.a05216c.tar.xz new file mode 100644 index 0000000..daf555e --- /dev/null +++ b/rpmlint-tests-84.87+git20170930.a05216c.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:68342457aa0a0e55de2482a10ff6607b2ae0540cea0a5e8bee734e67cb41ef1a +size 11204 diff --git a/rpmlint-tests.spec b/rpmlint-tests.spec index 88f3d30..c1dfde0 100644 --- a/rpmlint-tests.spec +++ b/rpmlint-tests.spec @@ -23,7 +23,7 @@ BuildRequires: rpmlint-Factory-strict BuildRequires: rpmlint-mini Name: rpmlint-tests -Version: 84.87+git20170930.921e051 +Version: 84.87+git20170930.a05216c Release: 0 Summary: rpmlint regression tests License: SUSE-Public-Domain From 0dbbdc5cb8a873fc6bd16f7473a4cd31b9ed0dba84ae3f2b40f7acac9ac4a04e Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sat, 30 Sep 2017 19:54:42 +0000 Subject: [PATCH 26/34] fix-diag-sortorder.diff, drop-unicodedata-dep.diff OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=507 --- drop-unicodedata-dep.diff | 31 +++++++++++++++++++++++++++++++ rpmlint.changes | 2 +- rpmlint.spec | 1 + 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 drop-unicodedata-dep.diff diff --git a/drop-unicodedata-dep.diff b/drop-unicodedata-dep.diff new file mode 100644 index 0000000..760bc3c --- /dev/null +++ b/drop-unicodedata-dep.diff @@ -0,0 +1,31 @@ +diff --git a/SpecCheck.py b/SpecCheck.py +index 8cb85b3..45ad404 100644 +--- a/SpecCheck.py ++++ b/SpecCheck.py +@@ -9,7 +9,6 @@ + + import re + import sys +-import unicodedata + try: + from urlparse import urlparse + except ImportError: # Python 3 +@@ -106,7 +105,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): +@@ -206,8 +205,7 @@ class SpecCheck(AbstractCheck.AbstractCheck): + if do_unicode: + line = unicode(line, "utf-8", "replace") # noqa false positive + +- char = line.find(nbsp) +- if char != -1: ++ if nbsp in line: + printWarning(pkg, "non-break-space", "line %s, char %d" % + (pkg.current_linenum, char)) + diff --git a/rpmlint.changes b/rpmlint.changes index 3970c5c..762cc71 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -91,7 +91,7 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, 0001-Execute-chroot-tests-also-on-x86-rpms.patch, ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff, - fix-diag-sortorder.diff + fix-diag-sortorder.diff, drop-unicodedata-dep.diff - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 94eae3a..7efde78 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -97,6 +97,7 @@ 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 Patch70: rpmlint-all-pie.patch # BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 BuildArch: noarch From aba7f46fdaad44991d6fc35fffc57a0ceab032f92024e6d323e7f14980c11c53 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 11:59:23 +0000 Subject: [PATCH 27/34] - drop version-control-internal-file.diff, boo1027577-license_tag.patch, add-weak-dependencies.diff: upstream OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=508 --- add-weak-dependencies.diff | 100 ------------------------------------- rpmlint.changes | 3 +- rpmlint.spec | 3 +- 3 files changed, 3 insertions(+), 103 deletions(-) delete mode 100644 add-weak-dependencies.diff diff --git a/add-weak-dependencies.diff b/add-weak-dependencies.diff deleted file mode 100644 index 2f80cdc..0000000 --- a/add-weak-dependencies.diff +++ /dev/null @@ -1,100 +0,0 @@ -Index: rpmlint-rpmlint-1.10/Pkg.py -=================================================================== ---- rpmlint-rpmlint-1.10.orig/Pkg.py -+++ rpmlint-rpmlint-1.10/Pkg.py -@@ -494,6 +494,10 @@ class Pkg(AbstractPkg): - self._missingok_files = None - self._files = None - self._requires = None -+ self._suggests = None -+ self._supplements = None -+ self._enhances = None -+ self._recommends = None - self._req_names = -1 - - if header: -@@ -771,6 +775,22 @@ class Pkg(AbstractPkg): - self._gatherDepInfo() - return self._requires - -+ def recommends(self): -+ self._gatherDepInfo() -+ return self._recommends -+ -+ def suggests(self): -+ self._gatherDepInfo() -+ return self._suggests -+ -+ def supplements(self): -+ self._gatherDepInfo() -+ return self._supplements -+ -+ def enhances(self): -+ self._gatherDepInfo() -+ return self._enhances -+ - def prereq(self): - """ - Get package PreReqs as list of -@@ -845,7 +865,7 @@ class Pkg(AbstractPkg): - - # internal function to gather dependency info used by the above ones - def _gather_aux(self, header, list, nametag, flagstag, versiontag, -- prereq=None): -+ prereq = None, strong_only = False, weak_only = False): - names = header[nametag] - flags = header[flagstag] - versions = header[versiontag] -@@ -856,7 +876,11 @@ class Pkg(AbstractPkg): - evr = stringToVersion(b2s(versions[loop])) - if prereq is not None and flags[loop] & PREREQ_FLAG: - prereq.append((name, flags[loop] & (~PREREQ_FLAG), evr)) -- else: -+ elif strong_only and flags[loop] & rpm.RPMSENSE_STRONG: -+ list.append((names[loop], versions[loop], flags[loop] & (~rpm.RPMSENSE_STRONG))) -+ elif weak_only and not (flags[loop] & rpm.RPMSENSE_STRONG): -+ list.append((names[loop], versions[loop], flags[loop])) -+ elif not (weak_only or strong_only): - list.append((name, flags[loop], evr)) - - def _gatherDepInfo(self): -@@ -924,6 +948,7 @@ class Pkg(AbstractPkg): - return prog - - -+ - def getInstalledPkgs(name): - """Get list of installed package objects by name.""" - -Index: rpmlint-rpmlint-1.10/TagsCheck.py -=================================================================== ---- rpmlint-rpmlint-1.10.orig/TagsCheck.py -+++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -889,8 +889,27 @@ class TagsCheck(AbstractCheck.AbstractCh - value = Pkg.formatRequire(*c) - self._unexpanded_macros(pkg, 'Conflicts %s' % (value,), value) - -+ for i in pkg.supplements(): -+ value = Pkg.formatRequire(*i) -+ self._unexpanded_macros(pkg, 'Supplements %s' % (value,), value) -+ -+ for i in pkg.suggests(): -+ value = Pkg.formatRequire(*i) -+ self._unexpanded_macros(pkg, 'Suggests %s' % (value,), value) -+ -+ for i in pkg.enhances(): -+ value = Pkg.formatRequire(*i) -+ self._unexpanded_macros(pkg, 'Enhances %s' % (value,), value) -+ -+ for i in pkg.recommends(): -+ value = Pkg.formatRequire(*i) -+ self._unexpanded_macros(pkg, 'Recommends %s' % (value,), value) -+ - obss = pkg.obsoletes() - if obss: -+ for obs in obss: -+ value = Pkg.formatRequire(*obs) -+ self._unexpanded_macros(pkg, 'Obsoletes %s' % (value,), value) - provs = pkg.provides() - for prov in provs: - for obs in obss: diff --git a/rpmlint.changes b/rpmlint.changes index 762cc71..96bb73a 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -82,7 +82,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com * FilesCheck: Update Python 3.5 and 3.6 bytecode magic values * test: Test for unexpected errors in default and C locales * Remove obsolete LC_ALL setting from Makefile -- drop version-control-internal-file.diff, boo1027577-license_tag.patch: upstream +- drop version-control-internal-file.diff, boo1027577-license_tag.patch, + add-weak-dependencies.diff: upstream - drop sourced-dirs.diff, fix-shared-library-matching.diff, suse-python-abi-check.diff, add-check-for-tmpfiles-created-at-r.diff: obsolete - drop suse-readd_terminator_in_regex.patch: merged into original patch diff --git a/rpmlint.spec b/rpmlint.spec index 7efde78..3dd8b49 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -77,7 +77,6 @@ Patch34: suse-check-optional-dependencies.diff Patch35: noarch-lib64.diff Patch36: suse-no-run-ldconfig.diff Patch37: description-check.diff -Patch38: add-weak-dependencies.diff Patch39: selfconflicts-provide.diff Patch40: no-badness-return.diff Patch41: suse-shlib-devel-dependency.diff @@ -110,8 +109,8 @@ source packages can be checked. %autosetup -n rpmlint-rpmlint-%{version} -a1 -p1 cp -p %{SOURCE2} . +chmod a-x rpmlint-checks-master/*.py # Only move top-level python files -chmod 0755 rpmlint-checks-master/*.py mv rpmlint-checks-master/*.py . %build From 7b11fac9ffed45719d32ae3624d8764c2e638875837e33d8a5a20f1b2de8385c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 12:06:10 +0000 Subject: [PATCH 28/34] fix-diag-sortorder.diff, drop-unicodedata-dep.diff, 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=509 --- ...ript-interpreter-check-to-lower-fals.patch | 35 +++++++++++++++++++ rpmlint.changes | 3 +- rpmlint.spec | 1 + 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch diff --git a/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch b/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch new file mode 100644 index 0000000..885edb3 --- /dev/null +++ b/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch @@ -0,0 +1,35 @@ +From 3433a3cc77a05af3a7e0588899f61028b5546e64 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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(-) + +diff --git a/FilesCheck.py b/FilesCheck.py +index 1852b38..0b93e73 100644 +--- a/FilesCheck.py ++++ b/FilesCheck.py +@@ -848,7 +848,10 @@ class FilesCheck(AbstractCheck.AbstractCheck): + 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 \ +-- +2.14.1 + diff --git a/rpmlint.changes b/rpmlint.changes index 96bb73a..8510738 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -92,7 +92,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com 0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch, 0001-Execute-chroot-tests-also-on-x86-rpms.patch, ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff, - fix-diag-sortorder.diff, drop-unicodedata-dep.diff + fix-diag-sortorder.diff, drop-unicodedata-dep.diff, + 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 3dd8b49..46b1a31 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -77,6 +77,7 @@ Patch34: suse-check-optional-dependencies.diff Patch35: noarch-lib64.diff Patch36: suse-no-run-ldconfig.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 From 2b5cea76f909c6c89c41720dca89c80c54002727f22a39d2ba9628590047216b Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 12:43:53 +0000 Subject: [PATCH 29/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=510 --- drop-unicodedata-dep.diff | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drop-unicodedata-dep.diff b/drop-unicodedata-dep.diff index 760bc3c..4a66b20 100644 --- a/drop-unicodedata-dep.diff +++ b/drop-unicodedata-dep.diff @@ -19,13 +19,3 @@ index 8cb85b3..45ad404 100644 def unversioned(deps): -@@ -206,8 +205,7 @@ class SpecCheck(AbstractCheck.AbstractCheck): - if do_unicode: - line = unicode(line, "utf-8", "replace") # noqa false positive - -- char = line.find(nbsp) -- if char != -1: -+ if nbsp in line: - printWarning(pkg, "non-break-space", "line %s, char %d" % - (pkg.current_linenum, char)) - From a18c3de7a94cdfdf5a752c6de3c6f9117f1782c90cc29bcc6b626bcdcb62c5ba Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 12:53:30 +0000 Subject: [PATCH 30/34] 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch, 0001-Improve-XDG-Menu-checks-stability.patch OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=511 --- 0001-Improve-XDG-Menu-checks-stability.patch | 122 +++++++++++++++++++ rpmlint.changes | 3 +- rpmlint.spec | 84 ++++++------- 3 files changed, 166 insertions(+), 43 deletions(-) create mode 100644 0001-Improve-XDG-Menu-checks-stability.patch diff --git a/0001-Improve-XDG-Menu-checks-stability.patch b/0001-Improve-XDG-Menu-checks-stability.patch new file mode 100644 index 0000000..b1305cd --- /dev/null +++ b/0001-Improve-XDG-Menu-checks-stability.patch @@ -0,0 +1,122 @@ +From 3df5fd9507215cf70a1147ea631cf061475c7b34 Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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 | 76 ++++++++++++++++++++++++++++++++++++++++----------------- + 1 file changed, 53 insertions(+), 23 deletions(-) + +Index: rpmlint-rpmlint-1.10/MenuXDGCheck.py +=================================================================== +--- rpmlint-rpmlint-1.10.orig/MenuXDGCheck.py ++++ rpmlint-rpmlint-1.10/MenuXDGCheck.py +@@ -8,15 +8,15 @@ + + import os + try: +- from ConfigParser import RawConfigParser ++ import ConfigParser as cfgparser + except: +- from configparser import RawConfigParser ++ import configparser as cfgparser + + import AbstractCheck + from Filter import addDetails, printError, printWarning + from Pkg import getstatusoutput, is_utf8 + +-STANDARD_BIN_DIRS = ['/bin/', '/sbin/', '/usr/bin/', '/usr/sbin/'] ++STANDARD_BIN_DIRS = ('/bin', '/sbin', '/usr/bin', '/usr/sbin') + + + class MenuXDGCheck(AbstractCheck.AbstractFilesCheck): +@@ -27,6 +27,43 @@ class MenuXDGCheck(AbstractCheck.Abstrac + AbstractCheck.AbstractFilesCheck.__init__( + self, "MenuXDGCheck", r"(?:/usr/share|/etc/opt/.*/share|/opt/.*)/applications/.*\.desktop$") + ++ def parse_desktop_file(self, pkg, root, f, filename): ++ cfp = cfgparser.RawConfigParser() ++ try: ++ cfp.read(f) ++ except cfgparser.DuplicateSectionError as e: ++ printError( ++ pkg, 'desktopfile-duplicate-section', filename, ++ '[%s]' % e.section) ++ except cfgparser.DuplicateOptionError as e: ++ printError( ++ pkg, 'desktopfile-duplicate-option', filename, ++ '[%s]/%s' % (e.section, e.option)) ++ except cfgparser.MissingSectionHeaderError: ++ printError( ++ pkg, 'desktopfile-missing-header', filename) ++ except (cfgparser.ParsingError, UnicodeDecodeError) as e: ++ printWarning( ++ pkg, 'invalid-desktopfile', filename) ++ 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() + f = root + filename +@@ -43,25 +80,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 +95,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.''', + ) diff --git a/rpmlint.changes b/rpmlint.changes index 8510738..d33bfd6 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -93,7 +93,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com 0001-Execute-chroot-tests-also-on-x86-rpms.patch, ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff, fix-diag-sortorder.diff, drop-unicodedata-dep.diff, - 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch + 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch, + 0001-Improve-XDG-Menu-checks-stability.patch - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 46b1a31..6743605 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -16,19 +16,13 @@ # -#!BuildIgnore: rpmlint-mini - Name: rpmlint -BuildRequires: obs-service-format_spec_file -BuildRequires: python3-flake8 -BuildRequires: python3-pytest -BuildRequires: python3-rpm -BuildRequires: xz +Version: 1.10 +Release: 0 Summary: Rpm correctness checker License: GPL-2.0+ Group: System/Packages -Version: 1.10 -Release: 0 +Url: https://github.com/rpm-software-management/rpmlint Source0: https://github.com/rpm-software-management/rpmlint/archive/rpmlint-%{version}.tar.gz Source1: rpmlint-checks-master.tar.xz Source2: config @@ -36,19 +30,6 @@ Source11: pie.config Source12: licenses.config Source99: README.packaging.txt Source100: syntax-validator.py -Url: https://github.com/rpm-software-management/rpmlint -Requires: /usr/bin/readelf -Requires: bash -Requires: checkbashisms -Requires: cpio -Requires: dash -Requires: desktop-file-utils -Requires: file -Requires: findutils -Requires: python3-magic -Requires: python3-pybeam -Requires: python3-rpm -Requires: python3-xml Patch00: rpmlint-suse.diff Patch01: suse-checks.diff Patch02: suse-version.diff @@ -81,6 +62,7 @@ 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 @@ -99,7 +81,24 @@ Patch62: ignore-readelf-ar-error.diff Patch63: fix-diag-sortorder.diff Patch64: drop-unicodedata-dep.diff Patch70: rpmlint-all-pie.patch -# BuildArch must at the end. is a bug: https://bugzilla.suse.com/show_bug.cgi?id=926766 +BuildRequires: obs-service-format_spec_file +BuildRequires: python3-flake8 +BuildRequires: python3-pytest +BuildRequires: python3-rpm +BuildRequires: xz +#!BuildIgnore: rpmlint-mini +Requires: %{_bindir}/readelf +Requires: bash +Requires: checkbashisms +Requires: cpio +Requires: dash +Requires: desktop-file-utils +Requires: file +Requires: findutils +Requires: python3-magic +Requires: python3-pybeam +Requires: python3-rpm +Requires: python3-xml BuildArch: noarch %description @@ -111,45 +110,46 @@ source packages can be checked. cp -p %{SOURCE2} . chmod a-x rpmlint-checks-master/*.py -# Only move top-level python files +# Only move top-level python files mv rpmlint-checks-master/*.py . %build -make %{?_smp_mflags} PYTHON=/usr/bin/python3 +make %{?_smp_mflags} PYTHON=%{_bindir}/python3 %install -make install DESTDIR=$RPM_BUILD_ROOT PYTHON=/usr/bin/python3 +make install DESTDIR=%{buildroot} PYTHON=%{_bindir}/python3 # the provided bash-completion does not work and only prints bash errors -rm -rf $RPM_BUILD_ROOT/etc/bash_completion.d -mv $RPM_BUILD_ROOT/etc/rpmlint/config $RPM_BUILD_ROOT/usr/share/rpmlint/config -head -n 8 $RPM_BUILD_ROOT/usr/share/rpmlint/config > $RPM_BUILD_ROOT/etc/rpmlint/config +rm -rf %{buildroot}%{_sysconfdir}/bash_completion.d +mv %{buildroot}%{_sysconfdir}/rpmlint/config %{buildroot}%{_datadir}/rpmlint/config +head -n 8 %{buildroot}%{_datadir}/rpmlint/config > %{buildroot}%{_sysconfdir}/rpmlint/config # make sure that the package is sane -for f in $RPM_BUILD_ROOT/usr/share/rpmlint/*.py $RPM_BUILD_ROOT/usr/share/rpmlint/config; do +for f in %{buildroot}%{_datadir}/rpmlint/*.py %{buildroot}%{_datadir}/rpmlint/config; do echo $f env LC_ALL=C.utf8 python3 -tt %{SOURCE100} $f done -%__install -m 644 %{SOURCE11} %{buildroot}/%{_sysconfdir}/rpmlint/ +install -m 644 %{SOURCE11} %{buildroot}/%{_sysconfdir}/rpmlint/ cp %{SOURCE12} licenses.config # note there is a tab character behind the -d, so don't copy&paste lightly -cut '-d ' -f1 /usr/lib/obs/service/format_spec_file.files/licenses_changes.txt | tail -n +2 | sort -u | while read l; do +cut '-d ' -f1 %{_prefix}/lib/obs/service/format_spec_file.files/licenses_changes.txt | tail -n +2 | sort -u | while read l; do sed -i -e "s/\(#VALIDLICENSES\)/\1\n '$l',/" licenses.config done -%__install -m 644 licenses.config %{buildroot}/%{_sysconfdir}/rpmlint/ +install -m 644 licenses.config %{buildroot}/%{_sysconfdir}/rpmlint/ %check -env PYTHON=/usr/bin/python3 ./test.sh +env PYTHON=%{_bindir}/python3 ./test.sh %files -%defattr(-,root,root,0755) -%doc COPYING INSTALL README* -%{_prefix}/bin/* -%{_prefix}/share/rpmlint -%config(noreplace) /etc/rpmlint/config +%license COPYING +%doc README* +%{_bindir}/rpmlint +%{_bindir}/rpmdiff +%{_datadir}/rpmlint +%config(noreplace) %{_sysconfdir}/rpmlint/config %config %{_sysconfdir}/rpmlint/pie.config %config %{_sysconfdir}/rpmlint/licenses.config -%dir /etc/rpmlint -/usr/share/man/man1/rpmlint.1.gz -/usr/share/man/man1/rpmdiff.1.gz +%dir %{_sysconfdir}/rpmlint +%{_mandir}/man1/rpmlint.1%{ext_man} +%{_mandir}/man1/rpmdiff.1%{ext_man} %changelog From 12c3f3df1b1c083ae856266cd379dfcc932ad7b847373854bd292549d5cad9ce Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 20:11:13 +0000 Subject: [PATCH 31/34] 0001-Improve-XDG-Menu-checks-stability.patch, 0001-split-wrong-script-interpreter-into-env-script-inter.patch OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=513 --- ...pt-interpreter-into-env-script-inter.patch | 70 +++++++++++++++++++ rpmlint.changes | 3 +- rpmlint.spec | 1 + 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 0001-split-wrong-script-interpreter-into-env-script-inter.patch diff --git a/0001-split-wrong-script-interpreter-into-env-script-inter.patch b/0001-split-wrong-script-interpreter-into-env-script-inter.patch new file mode 100644 index 0000000..3418adb --- /dev/null +++ b/0001-split-wrong-script-interpreter-into-env-script-inter.patch @@ -0,0 +1,70 @@ +From a4618650898aece5c4838e71853310b54f6e29fa Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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(-) + +diff --git a/FilesCheck.py b/FilesCheck.py +index 0b93e73..6a97601 100644 +--- a/FilesCheck.py ++++ b/FilesCheck.py +@@ -848,12 +848,15 @@ class FilesCheck(AbstractCheck.AbstractCheck): + 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')): +@@ -1280,10 +1283,27 @@ 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. ++ + Alternatively, if the file should not be executed, then ensure that + it is not marked as 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 +-- +2.14.1 + diff --git a/rpmlint.changes b/rpmlint.changes index d33bfd6..3f70e3e 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -94,7 +94,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com ignore-readelf-ar-error.diff, remove-ghostfile-checks.diff, fix-diag-sortorder.diff, drop-unicodedata-dep.diff, 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch, - 0001-Improve-XDG-Menu-checks-stability.patch + 0001-Improve-XDG-Menu-checks-stability.patch, + 0001-split-wrong-script-interpreter-into-env-script-inter.patch - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 6743605..61e434c 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -80,6 +80,7 @@ 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 Patch70: rpmlint-all-pie.patch BuildRequires: obs-service-format_spec_file BuildRequires: python3-flake8 From 946eb5c61614f2402e6f19882dad93c79b05f8766d84f1eec5a38b0b64207cc4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 20:20:21 +0000 Subject: [PATCH 32/34] OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=514 --- ...pt-interpreter-into-env-script-inter.patch | 22 ++++--------- ...x-to-avoid-false-positive-in-python-.patch | 32 +++++++++++++++++++ 2 files changed, 39 insertions(+), 15 deletions(-) diff --git a/0001-split-wrong-script-interpreter-into-env-script-inter.patch b/0001-split-wrong-script-interpreter-into-env-script-inter.patch index 3418adb..11e30c8 100644 --- a/0001-split-wrong-script-interpreter-into-env-script-inter.patch +++ b/0001-split-wrong-script-interpreter-into-env-script-inter.patch @@ -11,11 +11,11 @@ info message alongside that gives a better rationale. FilesCheck.py | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 0b93e73..6a97601 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -848,12 +848,15 @@ class FilesCheck(AbstractCheck.AbstractCheck): +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) @@ -37,13 +37,8 @@ index 0b93e73..6a97601 100644 elif not nonexec_file and not \ (lib_path_regex.search(f) and f.endswith('.la')): -@@ -1280,10 +1283,27 @@ 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. -+ - Alternatively, if the file should not be executed, then ensure that - it is not marked as executable. +@@ -1303,6 +1306,22 @@ Alternatively, if the file isn't suppose + it is not marked as being executable. ''', +'env-script-interpreter', @@ -65,6 +60,3 @@ index 0b93e73..6a97601 100644 '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 --- -2.14.1 - diff --git a/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch b/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch index 273f57c..b283c57 100644 --- a/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch +++ b/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch @@ -51,3 +51,35 @@ index f26c0c3..bfffda5 100644 -- 2.14.1 +diff --git a/FilesCheck.py b/FilesCheck.py +index 6a97601..abb3fa7 100644 +--- a/FilesCheck.py ++++ b/FilesCheck.py +@@ -196,7 +196,7 @@ devel_regex = re.compile(r'(.*)-(debug(info|source)?|devel|headers|source|static + 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\.[\d\.]+|\.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) +diff --git a/test/test_files.py b/test/test_files.py +index bfffda5..0192c13 100644 +--- a/test/test_files.py ++++ b/test/test_files.py +@@ -71,11 +71,13 @@ def test_lib_regex(): + assert all( + lib_regex.search(x) for x in + ('/lib/libnsl-2.26.so', +- '/lib64/libSegFault.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',)) From 2764482b3bd05ca0aaee195f2d71bd67476b6e2b48654ff5bc4508703791237c Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 4 Oct 2017 13:59:08 +0000 Subject: [PATCH 33/34] 0001-split-wrong-script-interpreter-into-env-script-inter.patch, 0001-Handle-post-scripts-that-contain-non-ascii-character.patch OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=515 --- ...xecute-chroot-tests-also-on-x86-rpms.patch | 15 +-- ...gex-to-capture-more-SCM-system-files.patch | 21 ++- ...pts-that-contain-non-ascii-character.patch | 120 ++++++++++++++++++ ...ript-interpreter-check-to-lower-fals.patch | 13 +- ...x-to-avoid-false-positive-in-python-.patch | 59 ++------- check-for-self-provides.diff | 2 +- drop-unicodedata-dep.diff | 10 +- ignore-readelf-ar-error.diff | 8 +- invalid-filerequires.diff | 2 +- noarch-lib64.diff | 4 +- rpmlint.changes | 3 +- rpmlint.spec | 1 + selfconflicts-provide.diff | 2 +- stricter-interpreter-check.diff | 2 +- suse-whitelist-opensuse.diff | 2 +- 15 files changed, 173 insertions(+), 91 deletions(-) create mode 100644 0001-Handle-post-scripts-that-contain-non-ascii-character.patch diff --git a/0001-Execute-chroot-tests-also-on-x86-rpms.patch b/0001-Execute-chroot-tests-also-on-x86-rpms.patch index 4f6409b..efdb41b 100644 --- a/0001-Execute-chroot-tests-also-on-x86-rpms.patch +++ b/0001-Execute-chroot-tests-also-on-x86-rpms.patch @@ -9,11 +9,11 @@ to do. BinariesCheck.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) -diff --git a/BinariesCheck.py b/BinariesCheck.py -index 887e0f0..26983bb 100644 ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -206,7 +206,8 @@ class BinaryInfo(object): +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 @@ -23,7 +23,7 @@ index 887e0f0..26983bb 100644 p = subprocess.Popen(('objdump', '-d', path), stdout=subprocess.PIPE, bufsize=-1, env=dict(os.environ, LC_ALL="C")) -@@ -531,7 +532,7 @@ class BinariesCheck(AbstractCheck.AbstractCheck): +@@ -578,7 +579,7 @@ class BinariesCheck(AbstractCheck.Abstra printError(pkg, 'missing-call-to-setgroups-before-setuid', fname) @@ -32,6 +32,3 @@ index 887e0f0..26983bb 100644 if not bin_info.chdir or not bin_info.chroot_near_chdir: printError(pkg, 'missing-call-to-chdir-with-chroot', fname) --- -2.14.1 - diff --git a/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch b/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch index 22a4d69..bea3e2a 100644 --- a/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch +++ b/0001-Extend-scm_regex-to-capture-more-SCM-system-files.patch @@ -9,11 +9,11 @@ Also add unit test coverage for it. test/test_files.py | 10 ++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index a7724de..87965bc 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -201,7 +201,9 @@ ldconfig_regex = re.compile(r'^[^#]*ldconfig', re.MULTILINE) +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)$') @@ -24,10 +24,10 @@ index a7724de..87965bc 100644 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) -diff --git a/test/test_files.py b/test/test_files.py -index 469a227..f26c0c3 100644 ---- a/test/test_files.py -+++ b/test/test_files.py +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") @@ -42,6 +42,3 @@ index 469a227..f26c0c3 100644 + assert scm_regex.search('/bar/foo,v') + assert scm_regex.search('bar/.svnignore') + assert scm_regex.search('bar/.git/refs') --- -2.14.1 - diff --git a/0001-Handle-post-scripts-that-contain-non-ascii-character.patch b/0001-Handle-post-scripts-that-contain-non-ascii-character.patch new file mode 100644 index 0000000..392ce28 --- /dev/null +++ b/0001-Handle-post-scripts-that-contain-non-ascii-character.patch @@ -0,0 +1,120 @@ +From 53b868fcaba87016c623f47e8d40e09f4fccaafa Mon Sep 17 00:00:00 2001 +From: Dirk Mueller +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)) diff --git a/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch b/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch index 885edb3..26c8a25 100644 --- a/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch +++ b/0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch @@ -14,11 +14,11 @@ warning about those, as there are more likely legitimate reasons. FilesCheck.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 1852b38..0b93e73 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -848,7 +848,10 @@ class FilesCheck(AbstractCheck.AbstractCheck): +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) @@ -30,6 +30,3 @@ index 1852b38..0b93e73 100644 printError(pkg, 'wrong-script-interpreter', f, interpreter, interpreter_args) elif not nonexec_file and not \ --- -2.14.1 - diff --git a/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch b/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch index b283c57..8a0482b 100644 --- a/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch +++ b/0003-Tighten-lib_regex-to-avoid-false-positive-in-python-.patch @@ -10,24 +10,24 @@ Also add unit test coverage for it. test/test_files.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) -diff --git a/FilesCheck.py b/FilesCheck.py -index 57de8fb..1852b38 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -196,7 +196,7 @@ devel_regex = re.compile(r'(.*)-(debug(info|source)?|devel|headers|source|static +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\.]+|\.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) -diff --git a/test/test_files.py b/test/test_files.py -index f26c0c3..bfffda5 100644 ---- a/test/test_files.py -+++ b/test/test_files.py -@@ -62,3 +62,20 @@ def test_scm_regex(): +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') @@ -40,46 +40,13 @@ index f26c0c3..bfffda5 100644 + assert all( + lib_regex.search(x) for x in + ('/lib/libnsl-2.26.so', -+ '/lib64/libSegFault.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/lib64/rsocket/binary',)) --- -2.14.1 - -diff --git a/FilesCheck.py b/FilesCheck.py -index 6a97601..abb3fa7 100644 ---- a/FilesCheck.py -+++ b/FilesCheck.py -@@ -196,7 +196,7 @@ devel_regex = re.compile(r'(.*)-(debug(info|source)?|devel|headers|source|static - 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\.[\d\.]+|\.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) -diff --git a/test/test_files.py b/test/test_files.py -index bfffda5..0192c13 100644 ---- a/test/test_files.py -+++ b/test/test_files.py -@@ -71,11 +71,13 @@ def test_lib_regex(): - assert all( - lib_regex.search(x) for x in - ('/lib/libnsl-2.26.so', -- '/lib64/libSegFault.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',)) ++ '/usr/lib64/rsocket/binary',)) diff --git a/check-for-self-provides.diff b/check-for-self-provides.diff index 4e3a170..f68c639 100644 --- a/check-for-self-provides.diff +++ b/check-for-self-provides.diff @@ -19,7 +19,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py for c in pkg.conflicts(): value = Pkg.formatRequire(*c) -@@ -1234,6 +1236,10 @@ objects should thus not be depended on a +@@ -1215,6 +1217,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.''', diff --git a/drop-unicodedata-dep.diff b/drop-unicodedata-dep.diff index 4a66b20..6e4e9e6 100644 --- a/drop-unicodedata-dep.diff +++ b/drop-unicodedata-dep.diff @@ -1,7 +1,7 @@ -diff --git a/SpecCheck.py b/SpecCheck.py -index 8cb85b3..45ad404 100644 ---- a/SpecCheck.py -+++ b/SpecCheck.py +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 @@ -10,7 +10,7 @@ index 8cb85b3..45ad404 100644 try: from urlparse import urlparse except ImportError: # Python 3 -@@ -106,7 +105,7 @@ filelist_regex = re.compile(r'\s+-f\s+\S+') +@@ -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) diff --git a/ignore-readelf-ar-error.diff b/ignore-readelf-ar-error.diff index 145c491..a4948cc 100644 --- a/ignore-readelf-ar-error.diff +++ b/ignore-readelf-ar-error.diff @@ -1,6 +1,8 @@ ---- a/BinariesCheck.py -+++ b/BinariesCheck.py -@@ -240,8 +240,11 @@ class BinaryInfo(object): +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 diff --git a/invalid-filerequires.diff b/invalid-filerequires.diff index 6c39f9d..75d0cb4 100644 --- a/invalid-filerequires.diff +++ b/invalid-filerequires.diff @@ -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]) -@@ -1181,6 +1185,12 @@ unneeded explicit Requires: tags.''', +@@ -1162,6 +1166,12 @@ unneeded explicit Requires: tags.''', '''This package provides 2 times the same capacity. It should only provide it once.''', diff --git a/noarch-lib64.diff b/noarch-lib64.diff index 762f7e0..ee35415 100644 --- a/noarch-lib64.diff +++ b/noarch-lib64.diff @@ -30,7 +30,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py is_elf = 'ELF' in pkgfile.magic is_ar = 'current ar archive' in pkgfile.magic is_ocaml_native = 'Objective caml native' in pkgfile.magic -@@ -596,9 +601,12 @@ class BinariesCheck(AbstractCheck.Abstra +@@ -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) @@ -44,7 +44,7 @@ Index: rpmlint-rpmlint-1.10/BinariesCheck.py if has_usr_lib_file and not binary_in_usr_lib: printWarning(pkg, 'only-non-binary-in-usr-lib') -@@ -623,6 +631,11 @@ FHS and the FSSTND forbid this.''', +@@ -619,6 +627,11 @@ FHS and the FSSTND forbid this.''', # 'non-sparc32-binary', # '', diff --git a/rpmlint.changes b/rpmlint.changes index 3f70e3e..43f64f4 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -95,7 +95,8 @@ Thu Sep 28 10:40:08 UTC 2017 - dmueller@suse.com fix-diag-sortorder.diff, drop-unicodedata-dep.diff, 0001-Tighten-wrong-script-interpreter-check-to-lower-fals.patch, 0001-Improve-XDG-Menu-checks-stability.patch, - 0001-split-wrong-script-interpreter-into-env-script-inter.patch + 0001-split-wrong-script-interpreter-into-env-script-inter.patch, + 0001-Handle-post-scripts-that-contain-non-ascii-character.patch - drop config.in: unused - switch to python 3.x diff --git a/rpmlint.spec b/rpmlint.spec index 61e434c..68afd46 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -81,6 +81,7 @@ 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 Patch70: rpmlint-all-pie.patch BuildRequires: obs-service-format_spec_file BuildRequires: python3-flake8 diff --git a/selfconflicts-provide.diff b/selfconflicts-provide.diff index 1683c58..bd26f41 100644 --- a/selfconflicts-provide.diff +++ b/selfconflicts-provide.diff @@ -28,7 +28,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py if prov_names.count(p) != 1 and p not in useless_provides: useless_provides.append(p) for p in useless_provides: -@@ -1030,6 +1033,10 @@ the Release tag.''', +@@ -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.''', diff --git a/stricter-interpreter-check.diff b/stricter-interpreter-check.diff index cd779ef..54916ac 100644 --- a/stricter-interpreter-check.diff +++ b/stricter-interpreter-check.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/FilesCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/FilesCheck.py +++ rpmlint-rpmlint-1.10/FilesCheck.py -@@ -869,7 +869,8 @@ class FilesCheck(AbstractCheck.AbstractC +@@ -872,7 +872,8 @@ class FilesCheck(AbstractCheck.AbstractC f.endswith('.la')): printError(pkg, 'script-without-shebang', f) diff --git a/suse-whitelist-opensuse.diff b/suse-whitelist-opensuse.diff index c41bc31..e340ee2 100644 --- a/suse-whitelist-opensuse.diff +++ b/suse-whitelist-opensuse.diff @@ -11,7 +11,7 @@ Index: rpmlint-rpmlint-1.10/TagsCheck.py =================================================================== --- rpmlint-rpmlint-1.10.orig/TagsCheck.py +++ rpmlint-rpmlint-1.10/TagsCheck.py -@@ -972,7 +972,7 @@ class TagsCheck(AbstractCheck.AbstractCh +@@ -953,7 +953,7 @@ class TagsCheck(AbstractCheck.AbstractCh spell_check(pkg, summary, 'Summary(%s)', lang, ignored_words) if '\n' in summary: printError(pkg, 'summary-on-multiple-lines', lang) From 3f5a9f163505a1fdf9adf86d61eb338c4b96e99fbfcc086549e4a36df1aee2c1 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Wed, 4 Oct 2017 16:26:55 +0000 Subject: [PATCH 34/34] suse-filesystem.diff, script-interpreter-only-for-exec-sc.diff: obsolete OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory:rpmlint/rpmlint?expand=0&rev=516 --- omit_BUILDROOT_from_pyo_files.patch | 14 ++++++++++++++ rpmlint.changes | 2 +- rpmlint.spec | 1 + 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 omit_BUILDROOT_from_pyo_files.patch diff --git a/omit_BUILDROOT_from_pyo_files.patch b/omit_BUILDROOT_from_pyo_files.patch new file mode 100644 index 0000000..b861e2e --- /dev/null +++ b/omit_BUILDROOT_from_pyo_files.patch @@ -0,0 +1,14 @@ +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 ; \ diff --git a/rpmlint.changes b/rpmlint.changes index 43f64f4..f4740a0 100644 --- a/rpmlint.changes +++ b/rpmlint.changes @@ -184,7 +184,7 @@ Thu Sep 28 09:37:04 UTC 2017 - dmueller@suse.com issue_68_BinariesCheck_lower_memory-3.patch, issue_68_BinariesCheck_lower_memory-4.patch, BinariesCheck_fix_chroot_check_on_non_x86.patch: either upstreamed as is or slightly different - drop suse-sysv-init-checks.diff, 0001-Avoid-messing-with-the-error-encoding-Fixes-61.patch, - suse-filesystem.diff: obsolete + suse-filesystem.diff, script-interpreter-only-for-exec-sc.diff: obsolete - drop update_git.sh related stuff: this is obsolete, patches are either supposed to be upstreamed or handled via quilt - add suse-skip-macro-expansion.diff: rename from remove-expand-macros.diff diff --git a/rpmlint.spec b/rpmlint.spec index 68afd46..3738107 100644 --- a/rpmlint.spec +++ b/rpmlint.spec @@ -82,6 +82,7 @@ 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 Patch70: rpmlint-all-pie.patch BuildRequires: obs-service-format_spec_file BuildRequires: python3-flake8