From 48ba464c68e111fb701d9ddc5c8859cfdef5999f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 22 Jul 2022 10:57:50 +0200 Subject: build: Fix warning about run_command() usage WARNING: You should add the boolean check kwarg to the run_command call. It currently defaults to false, but it will default to true in future releases of meson. See also: https://github.com/mesonbuild/meson/issues/9300 --- meson.build | 8 ++++---- tests/meson.build | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 075776f..6f0fadb 100644 --- a/meson.build +++ b/meson.build @@ -1,6 +1,6 @@ project( 'accountsservice', 'c', - version: run_command(['./generate-version.sh']).stdout().strip(), + version: run_command(['./generate-version.sh'], check: true).stdout().strip(), license: 'GPL3+', default_options: 'buildtype=debugoptimized', meson_version: '>= 0.50.0', @@ -102,7 +102,7 @@ elif cc.has_header_symbol('paths.h', '_PATH_WTMPX') config_h.set('PATH_WTMP', '_PATH_WTMPX') else path_wtmp = '/var/log/utx.log' - assert(run_command('test', '-e', path_wtmp).returncode() == 0, 'Do not know which filename to watch for wtmp changes') + assert(run_command('test', '-e', path_wtmp, check: false).returncode() == 0, 'Do not know which filename to watch for wtmp changes') config_h.set_quoted('PATH_WTMP', path_wtmp) endif @@ -186,10 +186,10 @@ endif # Core configuration admin_group = get_option('admin_group') if admin_group == '' - if run_command('test', '-e', '/etc/debian_version').returncode() == 0 + if run_command('test', '-e', '/etc/debian_version', check: false).returncode() == 0 admin_group = 'sudo' # FIXME: this has been left for documentation purposes - elif run_command('test', '-e', '/etc/sysconfig/network-scripts').returncode() == 0 + elif run_command('test', '-e', '/etc/sysconfig/network-scripts', check: false).returncode() == 0 admin_group = 'wheel' else admin_group = 'wheel' diff --git a/tests/meson.build b/tests/meson.build index d4a2570..ddbc680 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -17,7 +17,7 @@ if get_option('introspection') ] foreach module : python3_test_modules - if run_command(python3, '-c', 'import @0@'.format(module)).returncode() != 0 + if run_command(python3, '-c', 'import @0@'.format(module), check: false).returncode() != 0 python3_test_modules_found = false warning('Python3 module \'' + module + '\' needed by test suite not found') break @@ -38,7 +38,7 @@ if python3_test_modules_found base_args = test_file suite = ['accounts-service'] - r = run_command(unittest_inspector, test_file) + r = run_command(unittest_inspector, test_file, check: true) unit_tests = r.stdout().strip().split('\n') if r.returncode() == 0 and unit_tests.length() > 0 -- cgit v1.2.1