From: q66 Date: Sat, 6 Dec 2025 16:56:47 +0000 (+0100) Subject: meson: try BSD-style date(1) for alt_time_epoch as a fallback X-Git-Tag: v259-rc3~20^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=abf73cb072ff437a8778a1adf915ff9ae5f5fc85;p=thirdparty%2Fsystemd.git meson: try BSD-style date(1) for alt_time_epoch as a fallback If we fail to calculate alt_time_epoch using the GNU-style syntax, try if BSD-style syntax does not work. Fail for real if that does not work either. --- diff --git a/meson.build b/meson.build index 8d312dd70c1..547543b9c55 100644 --- a/meson.build +++ b/meson.build @@ -3028,8 +3028,12 @@ if conf.get('ENABLE_HWDB') == 1 alias_target('hwdb', auto_suspend_rules, executables_by_name.get('systemd-hwdb'), hwdb_units) endif -alt_time_epoch = run_command('date', '-Is', '-u', '-d', f'@@time_epoch@', - check : true).stdout().strip() +alt_time_epoch = run_command('date', '-Is', '-u', '-d', f'@@time_epoch@', check : false) +if alt_time_epoch.returncode() != 0 + # If the above fails, maybe the date(1) uses BSD-style syntax + alt_time_epoch = run_command('date', '-Iseconds', '-u', '-r', f'@time_epoch@', check : true) +endif +alt_time_epoch = alt_time_epoch.stdout().strip() summary({ 'split bin-sbin' : split_bin,