Skip to content

Commit 68a06b3

Browse files
committed
meson: Add check argument to remaining run_command() calls
1 parent bbec46c commit 68a06b3

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

man/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ endforeach
105105

106106
############################################################
107107

108-
have_lxml = run_command(xml_helper_py).returncode() == 0
108+
have_lxml = run_command(xml_helper_py, check: false).returncode() == 0
109109
if not have_lxml
110110
message('python-lxml not available, not making man page indices')
111111
endif

src/basic/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ filesystem_includes = ['linux/magic.h',
384384
'linux/gfs2_ondisk.h']
385385

386386
check_filesystems = find_program('check-filesystems.sh')
387-
r = run_command([check_filesystems, cpp, 'filesystems-gperf.gperf'] + filesystem_includes)
387+
r = run_command([check_filesystems, cpp, 'filesystems-gperf.gperf'] + filesystem_includes, check: false)
388388
if r.returncode() != 0
389389
error('found unknown filesystem(s) defined in kernel headers:\n\n' + r.stdout())
390390
r.stdout()

src/boot/efi/meson.build

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,11 @@ endif
5757
efi_libdir = ''
5858
foreach dir : [get_option('efi-libdir'),
5959
'/usr/lib/gnuefi' / efi_arch[0],
60-
run_command('realpath', '-e',
61-
'/usr/lib' / run_command(cc.cmd_array(), '-print-multi-os-directory').stdout().strip()).stdout().strip()]
60+
run_command(
61+
'realpath', '-e',
62+
'/usr/lib' / run_command(cc.cmd_array(), '-print-multi-os-directory', check: false).stdout().strip(),
63+
check: false
64+
).stdout().strip()]
6265
if dir != '' and fs.is_dir(dir)
6366
efi_libdir = dir
6467
break
@@ -125,7 +128,7 @@ elif get_option('sbat-distro') != ''
125128
value = get_option(sbatvar[0])
126129
if (value == '' or value == 'auto') and not meson.is_cross_build()
127130
cmd = 'if [ -e /etc/os-release ]; then . /etc/os-release; else . /usr/lib/os-release; fi; echo $@0@'.format(sbatvar[1])
128-
value = run_command(sh, '-c', cmd).stdout().strip()
131+
value = run_command(sh, '-c', cmd, check: true).stdout().strip()
129132
endif
130133
if value == ''
131134
error('Required @0@ option not set and autodetection failed'.format(sbatvar[0]))
@@ -254,7 +257,7 @@ if efi_arch[1] == 'arm'
254257
efi_ldflags += ['-Wl,--no-warn-mismatch']
255258
endif
256259

257-
if run_command('grep', '-q', '__CTOR_LIST__', efi_lds).returncode() == 0
260+
if run_command('grep', '-q', '__CTOR_LIST__', efi_lds, check: false).returncode() == 0
258261
# fedora has a patched gnu-efi that adds support for ELF constructors.
259262
# If ld is called by gcc something about these symbols breaks, resulting
260263
# in sd-boot freezing when gnu-efi runs the constructors. Force defining

src/test/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ test_hashmap_ordered_c = custom_target(
1111

1212
test_include_dir = include_directories('.')
1313

14-
path = run_command(sh, '-c', 'echo "$PATH"').stdout().strip()
14+
path = run_command(sh, '-c', 'echo "$PATH"', check: true).stdout().strip()
1515
test_env = environment()
1616
test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
1717
test_env.set('PATH', project_build_root + ':' + path)

test/fuzz/meson.build

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,13 @@ sanitize_address_undefined = custom_target(
1616

1717
sanitizers = [['address,undefined', sanitize_address_undefined]]
1818

19-
if git.found()
19+
if git.found() and fs.exists(project_source_root / '.git')
2020
out = run_command(env, '-u', 'GIT_WORK_TREE',
2121
git, '--git-dir=@0@/.git'.format(project_source_root),
22-
'ls-files', ':/test/fuzz/*/*')
22+
'ls-files', ':/test/fuzz/*/*',
23+
check: true)
2324
else
24-
out = run_command(sh, '-c', 'ls @0@/test/fuzz/*/*'.format(project_source_root))
25+
out = run_command(sh, '-c', 'ls @0@/test/fuzz/*/*'.format(project_source_root), check: true)
2526
endif
2627

2728
fuzz_regression_tests = []

test/meson.build

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,16 @@ endif
166166
if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
167167
udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh')
168168

169-
if git.found()
169+
if git.found() and fs.exists(project_source_root / '.git')
170170
out = run_command(
171171
env, '-u', 'GIT_WORK_TREE',
172172
git, '--git-dir=@0@/.git'.format(project_source_root),
173-
'ls-files', ':/test/dmidecode-dumps/*.bin')
173+
'ls-files', ':/test/dmidecode-dumps/*.bin',
174+
check: true)
174175
else
175176
out = run_command(
176-
sh, '-c', 'ls @0@/test/dmidecode-dumps/*.bin'.format(project_source_root))
177+
sh, '-c', 'ls @0@/test/dmidecode-dumps/*.bin'.format(project_source_root),
178+
check: true)
177179
endif
178180

179181
foreach p : out.stdout().split()

0 commit comments

Comments
 (0)