Patchwork cml1.bbclass: Only delay exit if the command fails

login
register
mail settings
Submitter Darren Hart
Date June 15, 2012, 9:44 p.m.
Message ID <88fd8e08d1933a78856c17245210d2ef7e4ae926.1339796664.git.dvhart@linux.intel.com>
Download mbox | patch
Permalink /patch/29983/
State New
Headers show

Comments

Darren Hart - June 15, 2012, 9:44 p.m.
Rather than pause for 5 seconds, test the return code of the command and
require user input before exiting on failure. This avoids pausing after
successful command execution as well as possibly not waiting long enough
if the user happens to be doing something else for 5 seconds.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
---
 meta/classes/cml1.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Darren Hart - June 18, 2012, 3:20 p.m.
I know, never send patches on Friday afternoon. So just pretend I just
now sent this. Early. Monday morning. ;-)

On 06/15/2012 02:44 PM, Darren Hart wrote:
> Rather than pause for 5 seconds, test the return code of the command and
> require user input before exiting on failure. This avoids pausing after
> successful command execution as well as possibly not waiting long enough
> if the user happens to be doing something else for 5 seconds.
> 
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
> ---
>  meta/classes/cml1.bbclass |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
> index bd25311..52d520a 100644
> --- a/meta/classes/cml1.bbclass
> +++ b/meta/classes/cml1.bbclass
> @@ -15,7 +15,7 @@ HOSTLDFLAGS = "${BUILD_LDFLAGS}"
>  HOST_LOADLIBES = "-lncurses"
>  
>  python do_menuconfig() {
> -        oe_terminal("${SHELL} -c \"make menuconfig; echo 'Pausing for 5 seconds'; sleep 5\"", '${PN} Configuration', d)
> +        oe_terminal("${SHELL} -c \"make menuconfig; if [ $? -ne 0 ]; then echo 'Command failed.'; echo -n 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d)
>  }
>  do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
>  do_menuconfig[nostamp] = "1"
>
Saul Wold - June 25, 2012, 4:02 p.m.
On 06/15/2012 02:44 PM, Darren Hart wrote:
> Rather than pause for 5 seconds, test the return code of the command and
> require user input before exiting on failure. This avoids pausing after
> successful command execution as well as possibly not waiting long enough
> if the user happens to be doing something else for 5 seconds.
>
> Signed-off-by: Darren Hart<dvhart@linux.intel.com>
> ---
>   meta/classes/cml1.bbclass |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
> index bd25311..52d520a 100644
> --- a/meta/classes/cml1.bbclass
> +++ b/meta/classes/cml1.bbclass
> @@ -15,7 +15,7 @@ HOSTLDFLAGS = "${BUILD_LDFLAGS}"
>   HOST_LOADLIBES = "-lncurses"
>
>   python do_menuconfig() {
> -        oe_terminal("${SHELL} -c \"make menuconfig; echo 'Pausing for 5 seconds'; sleep 5\"", '${PN} Configuration', d)
> +        oe_terminal("${SHELL} -c \"make menuconfig; if [ $? -ne 0 ]; then echo 'Command failed.'; echo -n 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d)
>   }
>   do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
>   do_menuconfig[nostamp] = "1"

Merged into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/classes/cml1.bbclass b/meta/classes/cml1.bbclass
index bd25311..52d520a 100644
--- a/meta/classes/cml1.bbclass
+++ b/meta/classes/cml1.bbclass
@@ -15,7 +15,7 @@  HOSTLDFLAGS = "${BUILD_LDFLAGS}"
 HOST_LOADLIBES = "-lncurses"
 
 python do_menuconfig() {
-        oe_terminal("${SHELL} -c \"make menuconfig; echo 'Pausing for 5 seconds'; sleep 5\"", '${PN} Configuration', d)
+        oe_terminal("${SHELL} -c \"make menuconfig; if [ $? -ne 0 ]; then echo 'Command failed.'; echo -n 'Press any key to continue... '; read r; fi\"", '${PN} Configuration', d)
 }
 do_menuconfig[depends] += "ncurses-native:do_populate_sysroot"
 do_menuconfig[nostamp] = "1"