]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: try BSD-style stat(1) syntax when failing mtime check
authorq66 <q66@chimera-linux.org>
Sat, 6 Dec 2025 16:55:04 +0000 (17:55 +0100)
committerq66 <q66@chimera-linux.org>
Mon, 8 Dec 2025 20:35:28 +0000 (21:35 +0100)
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

index 7fb845622dce40a58fb7d0105c76fe4e43534d4e..8d312dd70c1227f7e0bf3035f1ae3dd5d80e3cd2 100644 (file)
@@ -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