pkg-generic: check that SITE has a value when SOURCE
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 3 Jul 2016 09:50:01 +0000 (11:50 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sun, 3 Jul 2016 11:00:53 +0000 (13:00 +0200)
Currently, when an user forgets to define a SITE, he gets some fairly
weird download failure. In order to make things easier to diagnose, this
commit adds a check in the package infrastructure that verifies that if
SOURCE has a value, SITE is not empty.

Cc: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkg-generic.mk

index dab455c400f31f2d4617ba884ced57b42ee1ac4b..0c9c7ab744cb7d26f2dacae22fe3396f578eb33b 100644 (file)
@@ -938,6 +938,12 @@ endif
        $(1)-source \
        $(1)-source-check
 
+ifneq ($$($(2)_SOURCE),)
+ifeq ($$($(2)_SITE),)
+$$(error $(2)_SITE cannot be empty when $(2)_SOURCE is not)
+endif
+endif
+
 ifeq ($$(patsubst %/,ERROR,$$($(2)_SITE)),ERROR)
 $$(error $(2)_SITE ($$($(2)_SITE)) cannot have a trailing slash)
 endif