]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: Add check argument to remaining run_command() calls
authorJan Janssen <medhefgo@web.de>
Tue, 11 Jan 2022 09:56:22 +0000 (10:56 +0100)
committerJan Janssen <medhefgo@web.de>
Tue, 11 Jan 2022 13:56:30 +0000 (14:56 +0100)
man/meson.build
src/basic/meson.build
src/boot/efi/meson.build
src/test/meson.build
test/fuzz/meson.build
test/meson.build

index a06a60176707def5d386ad9705fb40a25d6a43a6..710b4ca0088542d47a97e0707b2f7fe5b3aea0a4 100644 (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
         message('python-lxml not available, not making man page indices')
 endif
index 229ac97c69afb76f56cdcfe149da0875dd7609e4..5a9e13d7417a47e024dd4a38115678997a21d996 100644 (file)
@@ -384,7 +384,7 @@ filesystem_includes = ['linux/magic.h',
                        'linux/gfs2_ondisk.h']
 
 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
         error('found unknown filesystem(s) defined in kernel headers:\n\n' + r.stdout())
         r.stdout()
index 3e948281f251befb23a5728b1e0de6314ea3231b..fad92f09a1cf7e43f1e9f9de860b516eb9a4e288 100644 (file)
@@ -57,8 +57,11 @@ endif
 efi_libdir = ''
 foreach dir : [get_option('efi-libdir'),
                '/usr/lib/gnuefi' / efi_arch[0],
-               run_command('realpath', '-e',
-                        '/usr/lib' / run_command(cc.cmd_array(), '-print-multi-os-directory').stdout().strip()).stdout().strip()]
+               run_command(
+                        '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)
                 efi_libdir = dir
                 break
@@ -125,7 +128,7 @@ elif get_option('sbat-distro') != ''
                 value = get_option(sbatvar[0])
                 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])
-                        value = run_command(sh, '-c', cmd).stdout().strip()
+                        value = run_command(sh, '-c', cmd, check: true).stdout().strip()
                 endif
                 if value == ''
                         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']
 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.
         # If ld is called by gcc something about these symbols breaks, resulting
         # in sd-boot freezing when gnu-efi runs the constructors. Force defining
index 2f9a82771cb65f30aa4c262a9759917e58f8d4ce..e245e0b7b2c64954a1433e6a7e67ca87293836f9 100644 (file)
@@ -11,7 +11,7 @@ test_hashmap_ordered_c = custom_target(
 
 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.set('SYSTEMD_LANGUAGE_FALLBACK_MAP', language_fallback_map)
 test_env.set('PATH', project_build_root + ':' + path)
index 706bdb329bda4d5050ed919d55ffe362721481a2..e8e17446e05fd3db5990a1f4bce66ce1bbe30dc4 100644 (file)
@@ -16,12 +16,13 @@ sanitize_address_undefined = custom_target(
 
 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',
                           git, '--git-dir=@0@/.git'.format(project_source_root),
-                          'ls-files', ':/test/fuzz/*/*')
+                          'ls-files', ':/test/fuzz/*/*',
+                          check: true)
 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
 
 fuzz_regression_tests = []
index 8de1043e170d28184935a99f57bf54f420561486..46eab4c1e14f9c2b2e0e96a8ec15a27f73931176 100644 (file)
@@ -166,14 +166,16 @@ endif
 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')
 
-        if git.found()
+        if git.found() and fs.exists(project_source_root / '.git')
                 out = run_command(
                         env, '-u', 'GIT_WORK_TREE',
                         git, '--git-dir=@0@/.git'.format(project_source_root),
-                        'ls-files', ':/test/dmidecode-dumps/*.bin')
+                        'ls-files', ':/test/dmidecode-dumps/*.bin',
+                        check: true)
         else
                 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
 
         foreach p : out.stdout().split()