From: Jo-Philipp Wich Date: Sat, 10 Jan 2015 18:19:59 +0000 (+0000) Subject: imagebuilder: fail with error if the passed profile name does not exist X-Git-Url: http://git.openwrt.org/?p=openwrt%2Fsvn-archive%2Farchive.git;a=commitdiff_plain;h=31c73fe2d8c7073e2f14961fa08dd3922ccc0bb3 imagebuilder: fail with error if the passed profile name does not exist Signed-off-by: Jo-Philipp Wich SVN-Revision: 43916 --- diff --git a/target/imagebuilder/files/Makefile b/target/imagebuilder/files/Makefile index 8136111b67..f3bfec1e31 100644 --- a/target/imagebuilder/files/Makefile +++ b/target/imagebuilder/files/Makefile @@ -78,6 +78,7 @@ define Profile 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 @@ info: (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)") \