[namcap] VCS requirements can be satisfied by depends=(...)

Message ID 20210503080830.3301532-1-arch@eckner.net
State New
Headers show
Series [namcap] VCS requirements can be satisfied by depends=(...) | expand

Commit Message

arch--- via arch-projects May 3, 2021, 8:08 a.m. UTC
From: Erich Eckner <git@eckner.net>

"W: VCS source PKGBUILD needs additional makedepends 'git' to work
properly" and co were too specific: It's sufficient to have the needed
package in depends=(). So we should check makedepends=() and depends=()
for needed packages.

Signed-off-by: Erich Eckner <git@eckner.net>
---
 Namcap/rules/makedepends.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch

diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
index b319e7c..2923e32 100644
--- a/Namcap/rules/makedepends.py
+++ b/Namcap/rules/makedepends.py
@@ -71,11 +71,11 @@  class VCSMakedepends(PkgbuildRule):
 
 		for v in protocols:
 			d = vcs[v]
-			if 'makedepends' not in pkginfo:
-				missing.append(d)
+			if 'makedepends' in pkginfo and d in pkginfo["makedepends"]:
 				continue
-			if d not in pkginfo["makedepends"]:
-				missing.append(d)
+			if 'depends' in pkginfo and d in pkginfo["depends"]:
+				continue
+			missing.append(d)
 
 		for i in missing:
 			self.warnings.append(("missing-vcs-makedeps %s", i))