Author: jow
Date: 2015-01-10 19:19:59 +0100 (Sat, 10 Jan 2015)
New Revision: 43916

Modified:
   trunk/target/imagebuilder/files/Makefile
Log:
imagebuilder: fail with error if the passed profile name does not exist

Signed-off-by: Jo-Philipp Wich <[email protected]>

Modified: trunk/target/imagebuilder/files/Makefile
===================================================================
--- trunk/target/imagebuilder/files/Makefile    2015-01-10 18:10:04 UTC (rev 
43915)
+++ trunk/target/imagebuilder/files/Makefile    2015-01-10 18:19:59 UTC (rev 
43916)
@@ -78,6 +78,7 @@
   endif
   $(1)_NAME:=$(NAME)
   $(1)_PACKAGES:=$(PACKAGES)
+  PROFILE_NAMES += $(1)
   PROFILE_LIST += \
        echo '$(1):'; [ -z '$(NAME)' ] || echo '        $(NAME)'; echo '        
Packages: $(PACKAGES)';
 endef
@@ -167,6 +168,13 @@
        (unset PROFILE FILES PACKAGES MAKEFLAGS; $(MAKE) -s _call_info)
 
 image:
+ifneq ($(PROFILE),)
+  ifeq ($(filter $(PROFILE),$(PROFILE_NAMES)),)
+       @echo 'Profile "$(PROFILE)" does not exist!'
+       @echo 'Use "make info" to get a list of available profile names.'
+       @exit 1
+  endif
+endif
        (unset PROFILE FILES PACKAGES MAKEFLAGS; \
        $(MAKE) _call_image \
                $(if $(PROFILE),USER_PROFILE="$(PROFILE)") \
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to