From 44361baff18d3b33a0b0299a5c6f847938521e21 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Mon, 7 Apr 2014 22:51:03 +0300 Subject: [PATCH] Slightly cleaner log output. --- dependencies.py | 24 +++++++++++++++++------- interpreter.py | 4 ++-- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dependencies.py b/dependencies.py index 1e10978e5..13fdcd31f 100644 --- a/dependencies.py +++ b/dependencies.py @@ -403,6 +403,8 @@ class GMockDependency(Dependency): def found(self): return self.is_found +qt5toolinfo_printed = False + class Qt5Dependency(Dependency): def __init__(self, kwargs): Dependency.__init__(self) @@ -418,10 +420,11 @@ class Qt5Dependency(Dependency): raise DependencyException('No Qt5 modules specified.') mlog.log('Dependency Qt5 tools:') self.find_exes() - + def find_exes(self): # The binaries have different names on different # distros. Joy. + global qt5toolinfo_printed self.moc = ExternalProgram('moc', silent=True) if not self.moc.found(): self.moc = ExternalProgram('moc-qt5', silent=True) @@ -448,9 +451,11 @@ class Qt5Dependency(Dependency): else: raise DependencyException('Moc preprocessor is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' moc:', mlog.green('YES'), '(%s)' % moc_ver) + if not qt5toolinfo_printed: + mlog.log(' moc:', mlog.green('YES'), '(%s)' % moc_ver) else: - mlog.log(' moc:', mlog.red('NO')) + if not qt5toolinfo_printed: + mlog.log(' moc:', mlog.red('NO')) if self.uic.found(): up = subprocess.Popen([self.uic.get_command(), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -464,9 +469,11 @@ class Qt5Dependency(Dependency): else: raise DependencyException('Uic compiler is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' uic:', mlog.green('YES'), '(%s)' % uic_ver) + if not qt5toolinfo_printed: + mlog.log(' uic:', mlog.green('YES'), '(%s)' % uic_ver) else: - mlog.log(' uic:', mlog.red('NO')) + if not qt5toolinfo_printed: + mlog.log(' uic:', mlog.red('NO')) if self.rcc.found(): rp = subprocess.Popen([self.rcc.get_command(), '-v'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -480,9 +487,12 @@ class Qt5Dependency(Dependency): else: raise DependencyException('Rcc compiler is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) - mlog.log(' rcc:', mlog.green('YES'), '(%s)' % rcc_ver) + if not qt5toolinfo_printed: + mlog.log(' rcc:', mlog.green('YES'), '(%s)' % rcc_ver) else: - mlog.log(' rcc:', mlog.red('NO')) + if not qt5toolinfo_printed: + mlog.log(' rcc:', mlog.red('NO')) + qt5toolinfo_printed = True def get_version(self): return self.modules[0].get_version() diff --git a/interpreter.py b/interpreter.py index 2a27b4b87..d81b47e5f 100644 --- a/interpreter.py +++ b/interpreter.py @@ -1052,7 +1052,6 @@ class Interpreter(): except coredata.MesonException as me: me.file = buildfilename raise me - mlog.log('Going to subdirectory "%s".' % self.subdir) self.evaluate_codeblock(codeblock) self.subdir = prev_subdir @@ -1167,7 +1166,8 @@ class Interpreter(): txt = ' cross build ' else: txt = ' build ' - mlog.log('Creating', txt, 'target "', mlog.bold(name), '" with %d files.' % len(sources), sep='') + displayname = os.path.join(l.held_object.subdir, name) + mlog.log('Creating', txt, 'target ', mlog.bold(displayname), ' with %d files.' % len(sources), sep='') self.global_flags_frozen = True return l