[namcap] recognize arch-specific variables even if packages is for only one architecture

Message ID 20190109101122.8704-1-arch@eckner.net
State New
Headers show
Series
  • [namcap] recognize arch-specific variables even if packages is for only one architecture
Related show

Commit Message

Erich Eckner Jan. 9, 2019, 10:11 a.m. UTC
From: Erich Eckner <arch@eckner.net>

Architecture-specific variables should be useable as soon as a package
is not built for 'any' architecture. With the deprecation of i686, this
becomes relevant, as many packages are now only built for x86_64.
However, the source (and checksums) may be _not_ architecture-agnostic,
e.g. should _not_ be listed as source= but source_x86_64=.

This patch silences the extra-var-begins-without-underscore message
which is currently emitted in that case.

Signed-off-by: Erich Eckner <arch@eckner.net>
---
 Namcap/rules/extravars.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/Namcap/rules/extravars.py b/Namcap/rules/extravars.py
index ba4df2d..81084f8 100644
--- a/Namcap/rules/extravars.py
+++ b/Namcap/rules/extravars.py
@@ -31,7 +31,7 @@  class package(PkgbuildRule):
 				 'pkgbase', 'pkgver', 'pkgrel', 'epoch', 'pkgdesc', 'groups',
 				 'url', 'install', 'changelog',
 				 'options', 'validpgpkeys'] + carch_vars
-		if 'arch' in pkginfo and len(pkginfo["arch"]) >= 2:
+		if 'arch' in pkginfo and pkginfo['arch'] != ['any']:
 			stdvars.extend(v+'_'+a for v,a in product(carch_vars, pkginfo["arch"]))
 		for varname in pkginfo["setvars"]:
 			if varname.islower() and varname not in stdvars \