Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] pkg-utils: mask tput failure for non-interactive sessions
@ 2016-02-21 16:04 James Knight
  2016-02-21 16:38 ` Yann E. MORIN
  2016-02-21 17:31 ` Thomas Petazzoni
  0 siblings, 2 replies; 3+ messages in thread
From: James Knight @ 2016-02-21 16:04 UTC (permalink / raw)
  To: buildroot

When invoking a build from a non-interactive session (for example, a
Jenkins build), there is no terminal session to modify. When preparing
variables to track the bold and boldoff mode sequences, the `tput`
command will always fail as there is no terminal to query. The following
change masks the error message when `tput` fails; leaving the TERM_BOLD
and TERM_RESET variables empty.

Signed-off-by: James Knight <james.d.knight@live.com>
---
Changes v1 -> v2:
  - Removed space in stderr redirection (suggested by Yann E. MORIN).
---
 package/pkg-utils.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
index 44bd2c9..f88313a 100644
--- a/package/pkg-utils.mk
+++ b/package/pkg-utils.mk
@@ -84,8 +84,8 @@ suitable-extractor = $(INFLATE$(suffix $(1)))
 
 # MESSAGE Macro -- display a message in bold type
 MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(call qstrip,$(1))$(TERM_RESET)"
-TERM_BOLD := $(shell tput smso)
-TERM_RESET := $(shell tput rmso)
+TERM_BOLD := $(shell tput smso 2>/dev/null)
+TERM_RESET := $(shell tput rmso 2>/dev/null)
 
 # Utility functions for 'find'
 # findfileclauses(filelist) => -name 'X' -o -name 'Y'
-- 
1.9.5.msysgit.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v2 1/1] pkg-utils: mask tput failure for non-interactive sessions
  2016-02-21 16:04 [Buildroot] [PATCH v2 1/1] pkg-utils: mask tput failure for non-interactive sessions James Knight
@ 2016-02-21 16:38 ` Yann E. MORIN
  2016-02-21 17:31 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2016-02-21 16:38 UTC (permalink / raw)
  To: buildroot

James, All,

On 2016-02-21 11:04 -0500, James Knight spake thusly:
> When invoking a build from a non-interactive session (for example, a
> Jenkins build), there is no terminal session to modify. When preparing
> variables to track the bold and boldoff mode sequences, the `tput`
> command will always fail as there is no terminal to query. The following
> change masks the error message when `tput` fails; leaving the TERM_BOLD
> and TERM_RESET variables empty.
> 
> Signed-off-by: James Knight <james.d.knight@live.com>

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

> ---
> Changes v1 -> v2:
>   - Removed space in stderr redirection (suggested by Yann E. MORIN).
> ---
>  package/pkg-utils.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk
> index 44bd2c9..f88313a 100644
> --- a/package/pkg-utils.mk
> +++ b/package/pkg-utils.mk
> @@ -84,8 +84,8 @@ suitable-extractor = $(INFLATE$(suffix $(1)))
>  
>  # MESSAGE Macro -- display a message in bold type
>  MESSAGE = echo "$(TERM_BOLD)>>> $($(PKG)_NAME) $($(PKG)_VERSION) $(call qstrip,$(1))$(TERM_RESET)"
> -TERM_BOLD := $(shell tput smso)
> -TERM_RESET := $(shell tput rmso)
> +TERM_BOLD := $(shell tput smso 2>/dev/null)
> +TERM_RESET := $(shell tput rmso 2>/dev/null)
>  
>  # Utility functions for 'find'
>  # findfileclauses(filelist) => -name 'X' -o -name 'Y'
> -- 
> 1.9.5.msysgit.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH v2 1/1] pkg-utils: mask tput failure for non-interactive sessions
  2016-02-21 16:04 [Buildroot] [PATCH v2 1/1] pkg-utils: mask tput failure for non-interactive sessions James Knight
  2016-02-21 16:38 ` Yann E. MORIN
@ 2016-02-21 17:31 ` Thomas Petazzoni
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2016-02-21 17:31 UTC (permalink / raw)
  To: buildroot

Dear James Knight,

On Sun, 21 Feb 2016 11:04:58 -0500, James Knight wrote:
> When invoking a build from a non-interactive session (for example, a
> Jenkins build), there is no terminal session to modify. When preparing
> variables to track the bold and boldoff mode sequences, the `tput`
> command will always fail as there is no terminal to query. The following
> change masks the error message when `tput` fails; leaving the TERM_BOLD
> and TERM_RESET variables empty.
> 
> Signed-off-by: James Knight <james.d.knight@live.com>
> ---
> Changes v1 -> v2:
>   - Removed space in stderr redirection (suggested by Yann E. MORIN).
> ---
>  package/pkg-utils.mk | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-21 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-21 16:04 [Buildroot] [PATCH v2 1/1] pkg-utils: mask tput failure for non-interactive sessions James Knight
2016-02-21 16:38 ` Yann E. MORIN
2016-02-21 17:31 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox