[namcap] Invalid "Non standard variable 'source_x86_64' ..." when x86_64 is the only arch
Task Info (Flyspray) | |
---|---|
Opened By | Antony Lee (anntzer) |
Task ID | 58552 |
Type | Bug Report |
Project | Arch Linux |
Category | Arch Projects |
Version | None |
OS | All |
Opened | 2018-05-12 09:34:50 UTC |
Status | Assigned |
Assignee | Kyle Keen (keenerd) |
Details
Description: When a package only supports one arch but has nominally arch-specific sources (e.g.: when we are just repackaging an arch-dependent binary from upstream, but upstream only provides binary for one of the arches supported by Arch Linux), it makes sense to specify the sources as "source_$arch" (e.g. "source_x86" instead of "source" (this usage is consistent with the "Tip" at https://wiki.archlinux.org/index.php/PKGBUILD#source). But namcap specifically throws a warning in that case; I consider the warning invalid.
Additional info:
- namcap 3.2.7
Steps to reproduce: Create the following PKGBUILD
Maintainer: me.
pkgname='foobar' pkgdesc='hello' url='https://not.an.url' license=('MIT') pkgver=0 pkgrel=0 arch=('x86_64') source_x86_64=('foobar.baz')
build() { true } package() { true }
and pass it to namcap. It prints: PKGBUILD (foobar) W: Non standard variable 'source_x86_64' doesn't start with an underscore
The relevant line is at https://git.archlinux.org/namcap.git/tree/Namcap/rules/extravars.py#n35, where arch-specific variables are considered only if len(pkginfo["arch"]) >= 2
. Deleting that clause should be sufficient; happy to provide a patch if that helps.