From 7bc9ea513a422b452d515da9435d6cd2e3827cd1 Mon Sep 17 00:00:00 2001 From: Anita Zhang Date: Fri, 25 Oct 2019 15:46:21 -0700 Subject: meson: expand ternary in functions to if statements Per https://github.com/mesonbuild/meson/issues/5003, ternary doesn't always work as function args with older versions of meson. Expand out ternary statements to stay compatible with older versions (< 0.49). --- meson.build | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index dc1fde60ee..0001504d53 100644 --- a/meson.build +++ b/meson.build @@ -796,8 +796,8 @@ conf.set_quoted('SYSTEMD_DEFAULT_LOCALE', default_locale) conf.set_quoted('GETTEXT_PACKAGE', meson.project_name()) service_watchdog = get_option('service-watchdog') -substs.set('SERVICE_WATCHDOG', - service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog) +watchdog_value = service_watchdog == '' ? '' : 'WatchdogSec=' + service_watchdog +substs.set('SERVICE_WATCHDOG', watchdog_value) substs.set('SUSHELL', get_option('debug-shell')) substs.set('DEBUGTTY', get_option('debug-tty')) @@ -3069,6 +3069,7 @@ run_target( command : [meson_check_api_docs_sh, libsystemd.full_path(), libudev.full_path()]) ############################################################ +watchdog_opt = service_watchdog == '' ? 'disabled' : service_watchdog status = [ '@0@ @1@'.format(meson.project_name(), meson.project_version()), @@ -3118,7 +3119,7 @@ status = [ 'default net.naming-scheme setting: @0@'.format(default_net_naming_scheme), 'default KillUserProcesses setting: @0@'.format(kill_user_processes), 'default locale: @0@'.format(default_locale), - 'systemd service watchdog: @0@'.format(service_watchdog == '' ? 'disabled' : service_watchdog)] + 'systemd service watchdog: @0@'.format(watchdog_opt)] alt_dns_servers = '\n '.join(dns_servers.split(' ')) alt_ntp_servers = '\n '.join(ntp_servers.split(' ')) -- cgit v1.2.3