Default verbosebuild on for non-tty outputs

This commit is contained in:
Kp 2015-08-14 03:02:04 +00:00
parent 655e7b6f72
commit 389cd42f47

View file

@ -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'),
),
},
{