1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-22 17:35:35 +03:00

meson: Add check argument to remaining run_command() calls

This commit is contained in:
Jan Janssen 2022-01-11 10:56:22 +01:00
parent bbec46c817
commit 68a06b3cdf
6 changed files with 19 additions and 13 deletions

View File

@ -105,7 +105,7 @@ endforeach
############################################################ ############################################################
have_lxml = run_command(xml_helper_py).returncode() == 0 have_lxml = run_command(xml_helper_py, check: false).returncode() == 0
if not have_lxml if not have_lxml
message('python-lxml not available, not making man page indices') message('python-lxml not available, not making man page indices')
endif endif

View File

@ -384,7 +384,7 @@ filesystem_includes = ['linux/magic.h',
'linux/gfs2_ondisk.h'] 'linux/gfs2_ondisk.h']
check_filesystems = find_program('check-filesystems.sh') check_filesystems = find_program('check-filesystems.sh')
r = run_command([check_filesystems, cpp, 'filesystems-gperf.gperf'] + filesystem_includes) r = run_command([check_filesystems, cpp, 'filesystems-gperf.gperf'] + filesystem_includes, check: false)
if r.returncode() != 0 if r.returncode() != 0
error('found unknown filesystem(s) defined in kernel headers:\n\n' + r.stdout()) error('found unknown filesystem(s) defined in kernel headers:\n\n' + r.stdout())
r.stdout() r.stdout()

View File

@ -57,8 +57,11 @@ endif
efi_libdir = '' efi_libdir = ''
foreach dir : [get_option('efi-libdir'), foreach dir : [get_option('efi-libdir'),
'/usr/lib/gnuefi' / efi_arch[0], '/usr/lib/gnuefi' / efi_arch[0],
run_command('realpath', '-e', run_command(
'/usr/lib' / run_command(cc.cmd_array(), '-print-multi-os-directory').stdout().strip()).stdout().strip()] 'realpath', '-e',
'/usr/lib' / run_command(cc.cmd_array(), '-print-multi-os-directory', check: false).stdout().strip(),
check: false
).stdout().strip()]
if dir != '' and fs.is_dir(dir) if dir != '' and fs.is_dir(dir)
efi_libdir = dir efi_libdir = dir
break break
@ -125,7 +128,7 @@ elif get_option('sbat-distro') != ''
value = get_option(sbatvar[0]) value = get_option(sbatvar[0])
if (value == '' or value == 'auto') and not meson.is_cross_build() if (value == '' or value == 'auto') and not meson.is_cross_build()
cmd = 'if [ -e /etc/os-release ]; then . /etc/os-release; else . /usr/lib/os-release; fi; echo $@0@'.format(sbatvar[1]) cmd = 'if [ -e /etc/os-release ]; then . /etc/os-release; else . /usr/lib/os-release; fi; echo $@0@'.format(sbatvar[1])
value = run_command(sh, '-c', cmd).stdout().strip() value = run_command(sh, '-c', cmd, check: true).stdout().strip()
endif endif
if value == '' if value == ''
error('Required @0@ option not set and autodetection failed'.format(sbatvar[0])) error('Required @0@ option not set and autodetection failed'.format(sbatvar[0]))
@ -254,7 +257,7 @@ if efi_arch[1] == 'arm'
efi_ldflags += ['-Wl,--no-warn-mismatch'] efi_ldflags += ['-Wl,--no-warn-mismatch']
endif endif
if run_command('grep', '-q', '__CTOR_LIST__', efi_lds).returncode() == 0 if run_command('grep', '-q', '__CTOR_LIST__', efi_lds, check: false).returncode() == 0
# fedora has a patched gnu-efi that adds support for ELF constructors. # fedora has a patched gnu-efi that adds support for ELF constructors.
# If ld is called by gcc something about these symbols breaks, resulting # If ld is called by gcc something about these symbols breaks, resulting
# in sd-boot freezing when gnu-efi runs the constructors. Force defining # in sd-boot freezing when gnu-efi runs the constructors. Force defining

View File

@ -11,7 +11,7 @@ test_hashmap_ordered_c = custom_target(
test_include_dir = include_directories('.') test_include_dir = include_directories('.')
path = run_command(sh, '-c', 'echo "$PATH"').stdout().strip() path = run_command(sh, '-c', 'echo "$PATH"', check: true).stdout().strip()
test_env = environment() test_env = environment()
test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map) test_env.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
test_env.set('PATH', project_build_root + ':' + path) test_env.set('PATH', project_build_root + ':' + path)

View File

@ -16,12 +16,13 @@ sanitize_address_undefined = custom_target(
sanitizers = [['address,undefined', sanitize_address_undefined]] sanitizers = [['address,undefined', sanitize_address_undefined]]
if git.found() if git.found() and fs.exists(project_source_root / '.git')
out = run_command(env, '-u', 'GIT_WORK_TREE', out = run_command(env, '-u', 'GIT_WORK_TREE',
git, '--git-dir=@0@/.git'.format(project_source_root), git, '--git-dir=@0@/.git'.format(project_source_root),
'ls-files', ':/test/fuzz/*/*') 'ls-files', ':/test/fuzz/*/*',
check: true)
else else
out = run_command(sh, '-c', 'ls @0@/test/fuzz/*/*'.format(project_source_root)) out = run_command(sh, '-c', 'ls @0@/test/fuzz/*/*'.format(project_source_root), check: true)
endif endif
fuzz_regression_tests = [] fuzz_regression_tests = []

View File

@ -166,14 +166,16 @@ endif
if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family()) if want_tests != 'false' and dmi_arches.contains(host_machine.cpu_family())
udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh') udev_dmi_memory_id_test = find_program('udev-dmi-memory-id-test.sh')
if git.found() if git.found() and fs.exists(project_source_root / '.git')
out = run_command( out = run_command(
env, '-u', 'GIT_WORK_TREE', env, '-u', 'GIT_WORK_TREE',
git, '--git-dir=@0@/.git'.format(project_source_root), git, '--git-dir=@0@/.git'.format(project_source_root),
'ls-files', ':/test/dmidecode-dumps/*.bin') 'ls-files', ':/test/dmidecode-dumps/*.bin',
check: true)
else else
out = run_command( out = run_command(
sh, '-c', 'ls @0@/test/dmidecode-dumps/*.bin'.format(project_source_root)) sh, '-c', 'ls @0@/test/dmidecode-dumps/*.bin'.format(project_source_root),
check: true)
endif endif
foreach p : out.stdout().split() foreach p : out.stdout().split()