[namcap] Fix makedepends.py for PKGBUILD without source array

Message ID 20200120095759.3344-1-michael.straube@posteo.de
State New
Headers show
Series
  • [namcap] Fix makedepends.py for PKGBUILD without source array
Related show

Commit Message

Eli Schwartz via arch-projects Jan. 20, 2020, 9:57 a.m. UTC
Namcap errors when a PKGBUILD has no source array. Test if the PKGBUILD
has a source array in the VCSMakedepends rule to avoid such errors.

Fixes FS#65042

Signed-off-by: Michael Straube <michael.straube@posteo.de>
---
 Namcap/rules/makedepends.py | 3 +++
 1 file changed, 3 insertions(+)

Patch

diff --git a/Namcap/rules/makedepends.py b/Namcap/rules/makedepends.py
index 53676c2..380a089 100644
--- a/Namcap/rules/makedepends.py
+++ b/Namcap/rules/makedepends.py
@@ -56,6 +56,9 @@  class VCSMakedepends(PkgbuildRule):
 		missing = []
 		protocols = set()
 
+		if 'source' not in pkginfo:
+			return
+
 		for s in pkginfo["source"]:
 			p = s.split("::", 1)[-1]
 			p = p.split("://", 1)[0]