From 7e805a019ae4d923403af8032776c0c302e3a50c Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sun, 19 Feb 2017 03:19:13 +0530 Subject: find_program: Fix implementation of .path() And actually test that prog.path() works. The earlier test was just running the command without checking if it succeeded. Also make everything use prog.get_command() or get_path() instead of accessing the internal member prog.fullpath directly. --- mesonbuild/modules/qt4.py | 6 +++--- mesonbuild/modules/qt5.py | 6 +++--- mesonbuild/modules/rpm.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'mesonbuild/modules') diff --git a/mesonbuild/modules/qt4.py b/mesonbuild/modules/qt4.py index 33c9f80..7146739 100644 --- a/mesonbuild/modules/qt4.py +++ b/mesonbuild/modules/qt4.py @@ -48,7 +48,7 @@ class Qt4Module(ExtensionModule): raise MesonException('Moc preprocessor is not for Qt 4. Output:\n%s\n%s' % (stdout, stderr)) mlog.log(' moc:', mlog.green('YES'), '(%s, %s)' % - (' '.join(self.moc.fullpath), moc_ver.split()[-1])) + (self.moc.get_path(), moc_ver.split()[-1])) else: mlog.log(' moc:', mlog.red('NO')) if self.uic.found(): @@ -61,7 +61,7 @@ class Qt4Module(ExtensionModule): raise MesonException('Uic compiler is not for Qt4. Output:\n%s\n%s' % (stdout, stderr)) mlog.log(' uic:', mlog.green('YES'), '(%s, %s)' % - (' '.join(self.uic.fullpath), uic_ver.split()[-1])) + (self.uic.get_path(), uic_ver.split()[-1])) else: mlog.log(' uic:', mlog.red('NO')) if self.rcc.found(): @@ -74,7 +74,7 @@ class Qt4Module(ExtensionModule): raise MesonException('Rcc compiler is not for Qt 4. Output:\n%s\n%s' % (stdout, stderr)) mlog.log(' rcc:', mlog.green('YES'), '(%s, %s)' - % (' '.join(self.rcc.fullpath), rcc_ver.split()[-1])) + % (self.rcc.get_path(), rcc_ver.split()[-1])) else: mlog.log(' rcc:', mlog.red('NO')) self.tools_detected = True diff --git a/mesonbuild/modules/qt5.py b/mesonbuild/modules/qt5.py index b4f1475..2a87a80 100644 --- a/mesonbuild/modules/qt5.py +++ b/mesonbuild/modules/qt5.py @@ -50,7 +50,7 @@ class Qt5Module(ExtensionModule): raise MesonException('Moc preprocessor is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) mlog.log(' moc:', mlog.green('YES'), '(%s, %s)' % - (' '.join(self.moc.fullpath), moc_ver.split()[-1])) + (self.moc.get_path(), moc_ver.split()[-1])) else: mlog.log(' moc:', mlog.red('NO')) if self.uic.found(): @@ -65,7 +65,7 @@ class Qt5Module(ExtensionModule): raise MesonException('Uic compiler is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) mlog.log(' uic:', mlog.green('YES'), '(%s, %s)' % - (' '.join(self.uic.fullpath), uic_ver.split()[-1])) + (self.uic.get_path(), uic_ver.split()[-1])) else: mlog.log(' uic:', mlog.red('NO')) if self.rcc.found(): @@ -80,7 +80,7 @@ class Qt5Module(ExtensionModule): raise MesonException('Rcc compiler is not for Qt 5. Output:\n%s\n%s' % (stdout, stderr)) mlog.log(' rcc:', mlog.green('YES'), '(%s, %s)' - % (' '.join(self.rcc.fullpath), rcc_ver.split()[-1])) + % (self.rcc.get_path(), rcc_ver.split()[-1])) else: mlog.log(' rcc:', mlog.red('NO')) self.tools_detected = True diff --git a/mesonbuild/modules/rpm.py b/mesonbuild/modules/rpm.py index bd8a3c4..b967863 100644 --- a/mesonbuild/modules/rpm.py +++ b/mesonbuild/modules/rpm.py @@ -108,7 +108,7 @@ class RPMModule(ExtensionModule): fn.write('BuildRequires: %%{_bindir}/%s # FIXME\n' % prog.get_name()) else: - fn.write('BuildRequires: %s\n' % ' '.join(prog.fullpath)) + fn.write('BuildRequires: {}\n'.format(prog.get_path())) fn.write('BuildRequires: meson\n') fn.write('\n') fn.write('%description\n') -- cgit v1.1