diff mbox

[U-Boot] kconfig: show an error message when defconfig is not found

Message ID 1409777300-32069-1-git-send-email-yamada.m@jp.panasonic.com
State Superseded
Headers show

Commit Message

Masahiro Yamada Sept. 3, 2014, 8:48 p.m. UTC
When a non-existing defconfig is specified,
display an easy-to-understand message
(fake the error message on Linux Kernel):

  $ make foo_defconfig
  ***
  *** Can't find default configuration "confis/foo_defconfig"!
  ***

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

 scripts/multiconfig.sh | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Stephen Warren Sept. 3, 2014, 8:56 p.m. UTC | #1
On 09/03/2014 02:48 PM, Masahiro Yamada wrote:
> When a non-existing defconfig is specified,
> display an easy-to-understand message
> (fake the error message on Linux Kernel):
>
>    $ make foo_defconfig
>    ***
>    *** Can't find default configuration "confis/foo_defconfig"!
>    ***

Echo to stderr rather than stdout seems better for an error message. I'm 
not sure the *** banner part of the message is that useful, but it's not 
a big deal.
diff mbox

Patch

diff --git a/scripts/multiconfig.sh b/scripts/multiconfig.sh
index a579042..af8dbe1 100644
--- a/scripts/multiconfig.sh
+++ b/scripts/multiconfig.sh
@@ -118,6 +118,13 @@  do_board_defconfig () {
 	defconfig_path=$srctree/configs/$1
 	tmp_defconfig_path=configs/.tmp_defconfig
 
+	if [ ! -r $defconfig_path ]; then
+		echo "***"
+		echo "*** Can't find default configuration \"confis/$1\"!"
+		echo "***"
+		exit 1
+	fi
+
 	mkdir -p arch configs
 	# defconfig for Normal:
 	#  pick lines without prefixes and lines starting '+' prefix