Complain loudly if BR2_GLOBAL_PATCH_DIR does not exit
authorMichal Sojka <sojka@merica.cz>
Tue, 21 Oct 2014 08:42:54 +0000 (10:42 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Fri, 24 Oct 2014 23:58:12 +0000 (01:58 +0200)
If the BR2_GLOBAL_PATCH_DIR is misspelled in the .config or if somebody
renamed the existing directory with patches, buildroot happily builds
everything but without the patches. As this can lead to surprising
results, it is better to fail and give a user a message that
BR2_GLOBAL_PATCH_DIR is wrongly configured.

Signed-off-by: Michal Sojka <sojka@merica.cz>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/pkg-generic.mk

index 7a6d5e67b7d4dc8903d38229a34bb39df779933b..9643a30e24f51e4656d75694475a68537f778ed2 100644 (file)
@@ -162,6 +162,11 @@ $(BUILD_DIR)/%/.stamp_patched:
        $(Q)touch $@
        @$(call step_end,patch)
 
+# Check that all directories specified in BR2_GLOBAL_PATCH_DIR exist.
+$(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\
+       $(if $(wildcard $(dir)),,\
+               $(error BR2_GLOBAL_PATCH_DIR contains nonexistent directory $(dir))))
+
 # Configure
 $(BUILD_DIR)/%/.stamp_configured:
        @$(call step_start,configure)