From 4307befea4f049e7ac4235929a5ee543b9947749 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 17 May 2022 15:07:41 +0200 Subject: [PATCH] Skip undefined-non-weak-symbol for python packages. Python packages can potentially have unresolved symbols. Fixes: #864 --- rpmlint/checks/BinariesCheck.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/rpmlint/checks/BinariesCheck.py b/rpmlint/checks/BinariesCheck.py index a90abb060..c646cc3a3 100644 --- a/rpmlint/checks/BinariesCheck.py +++ b/rpmlint/checks/BinariesCheck.py @@ -31,6 +31,7 @@ class BinariesCheck(AbstractCheck): la_file_regex = re.compile(r'\.la$') invalid_dir_ref_regex = re.compile(r'/(home|tmp)(\W|$)') usr_arch_share_regex = re.compile(r'/share/.*/(?:x86|i.86|x86_64|ppc|ppc64|s390|s390x|ia64|m68k|arm|aarch64|mips|riscv)') + python_module_regex = re.compile(r'.*\.\w*(python|pypy)\w*(-\w+){4}\.so') lto_text_like_sections = {'.preinit_array', '.init_array', '.fini_array'} # The following sections are part of the RX ABI and do correspond to .text, .data and .bss @@ -373,6 +374,11 @@ def _check_dependency(self, pkg, pkgfile): # following issues are errors for shared libs and warnings for executables if not self.is_dynamically_linked: return + + # Skip python packages + if self.python_module_regex.fullmatch(pkgfile.name): + return + if not self.is_archive and not self.readelf_parser.is_debug: info_type = 'E' if self.readelf_parser.is_shlib else 'W' for symbol in self.ldd_parser.undefined_symbols: