From 57f911973ae5e9936fdfae994db6c900ef051c91 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 6 Dec 2025 17:55:04 +0100 Subject: [PATCH] meson: try BSD-style stat(1) syntax when failing mtime check The system may be using a stat(1) implementation that follows BSD-style syntax. Try that as a fallback, but do fail for real if that also fails. --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 7fb845622d..8d312dd70c 100644 --- a/meson.build +++ b/meson.build @@ -775,7 +775,13 @@ if time_epoch <= 0 if time_epoch == '' NEWS = files('NEWS') time_epoch = run_command(stat, '-c', '%Y', NEWS, - check : true).stdout() + check : false) + if time_epoch.returncode() != 0 + # If the above fails, maybe the stat(1) uses BSD-style syntax + time_epoch = run_command(stat, '-f', '%m', NEWS, + check : true) + endif + time_epoch = time_epoch.stdout() endif time_epoch = time_epoch.strip().to_int() endif