[namcap] silently skip over packages of type ${pkgbase}-debug

Message ID 20200419210143.1294353-1-eschwartz@archlinux.org
State New
Headers show
Series [namcap] silently skip over packages of type ${pkgbase}-debug | expand

Commit Message

Emil Velikov via arch-projects April 19, 2020, 9:01 p.m. UTC
These produce many false positives, for example ELF warnings for split
debug info. Under no circumstances do we want to claim there are any
errors here, since makepkg autogenerates the package and we presume it's
always right. Issues will always occur in the main package(s) only.

Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
---
 Namcap/package.py | 2 +-
 namcap.py         | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

Patch

diff --git a/Namcap/package.py b/Namcap/package.py
index 2da5b1d..86129fe 100644
--- a/Namcap/package.py
+++ b/Namcap/package.py
@@ -209,7 +209,7 @@  def load_from_pkgbuild(path):
 	return ret
 
 def load_from_alpm(pmpkg):
-	variables = ['name', 'version', 'conflicts', 'url',
+	variables = ['base', 'name', 'version', 'conflicts', 'url',
 			'depends', 'desc', 'files', 'groups',
 			'has_scriptlet', 'size', 'licenses',
 			'optdepends', 'packager', 'provides', 'replaces']
diff --git a/namcap.py b/namcap.py
index a7f532a..dcf06f7 100755
--- a/namcap.py
+++ b/namcap.py
@@ -86,6 +86,10 @@  def process_realpackage(package, modules):
 		return 1
 
 	pkginfo = Namcap.package.load_from_tarball(package)
+
+	if pkginfo['name'] == pkginfo['base'] + '-debug':
+		# there are no errors -- this is a debug package autogenerated by makepkg
+		return 0
 	# Loop through each one, load them apply if possible
 	for i in modules:
 		rule = get_modules()[i]()