From 946eb5c61614f2402e6f19882dad93c79b05f8766d84f1eec5a38b0b64207cc4 Mon Sep 17 00:00:00 2001 From: Dirk Mueller Date: Sun, 1 Oct 2017 20:20:21 +0000 Subject: [PATCH] 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',))