From 05dbc1f226980a46001ed472ca8e34c83c8128c0 Mon Sep 17 00:00:00 2001
From: Michael Straube <michael.straube@posteo.de>
Date: Mon, 20 Jan 2020 10:57:59 +0100
Subject: Fix makedepends.py for PKGBUILD without source array

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 at posteo.de>
Signed-off-by: Kyle Keen <keenerd@gmail.com>
---
 Namcap/rules/makedepends.py | 3 +++
 1 file changed, 3 insertions(+)

(limited to 'Namcap/rules/makedepends.py')

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]
-- 
cgit v1.2.3-1-gf6bb5

