pkg-utils: mask tput failure for non-interactive sessions
PATCH v2 1/1 pkg-utils: mask tput failure for non-interactive sessions
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.
---
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(-)
package/pkg-utils.mk +2 -2
@@ -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'
Signature · 1 line
1.9.5.msysgit.1
PATCH v2 1/1 pkg-utils: mask tput failure for non-interactive sessions
James, All,
On 2016-02-21 11:04 -0500, James Knight spake thusly:
Quoted 8 lines
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
tputcommand will always fail as there is no terminal to query. The following change masks the error message whentputfails; leaving theTERM_BOLDandTERM_RESETvariables empty.Signed-off-by James Knight <[email protected]>
Regards,
Yann E. MORIN.
Quoted 29 lines
---
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(-)package/pkg-utils.mk +2
-2@@ -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'Signature · 6 lines
1.9.5.msysgit.1 _______________________________________________ buildroot mailing list buildroot at busybox.net http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | 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. | '------------------------------^-------^------------------^--------------------'
Thomas Petazzoni
AppliedPATCH v2 1/1 pkg-utils: mask tput failure for non-interactive sessions
In reply to James KnightDear James Knight,
Quoted 7 lines · James Knight
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
tputcommand will always fail as there is no terminal to query. The following change masks the error message whentputfails; leaving theTERM_BOLDandTERM_RESETvariables empty.
Quoted 7 lines
Signed-off-by James Knight <[email protected]>---
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com