From 389cd42f473083c486a21f1816979758fdb00489 Mon Sep 17 00:00:00 2001 From: Kp Date: Fri, 14 Aug 2015 03:02:04 +0000 Subject: [PATCH] Default verbosebuild on for non-tty outputs --- SConstruct | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index 1fbf15b80..a723d01f2 100644 --- a/SConstruct +++ b/SConstruct @@ -1296,6 +1296,7 @@ class DXXCommon(LazyObjectConstructor): RPI_DEFAULT_VC_PATH='/opt/vc' default_OGLES_LIB = 'GLES_CM' _default_prefix = '/usr/local' + __stdout_is_not_a_tty = None def default_builddir(self): builddir_prefix = self.builddir_prefix builddir_suffix = self.builddir_suffix @@ -1337,6 +1338,18 @@ class DXXCommon(LazyObjectConstructor): if self.raspberrypi: return True return False + @classmethod + def default_verbosebuild(cls): + # Enable verbosebuild when the output is not directed to a + # terminal. When output is not a terminal, it is likely + # either a pager or a log file, both of which can readily + # handle the very long lines generated by verbose mode. + r = cls.__stdout_is_not_a_tty + if r is None: + isatty = getattr(sys.stdout, 'isatty', None) + # If isatty is None, then assume output is a TTY. + cls.__stdout_is_not_a_tty = r = False if isatty is None else not isatty() + return r def selected_OGLES_LIB(self): if self.raspberrypi: return 'GLESv2' @@ -1392,7 +1405,7 @@ class DXXCommon(LazyObjectConstructor): ('ipv6', False, 'enable IPv6 compability'), ('use_udp', True, 'enable UDP support'), ('use_tracker', True, 'enable Tracker support (requires UDP)'), - ('verbosebuild', False, 'print out all compiler/linker messages during building'), + ('verbosebuild', self.default_verbosebuild, 'print out all compiler/linker messages during building'), ), }, {