From f40bd7af20d88e9609b997edd91df5b52ad983f8 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 6 Dec 2025 17:53:29 +0100 Subject: [PATCH 1/4] meson: drop ln --relative check The coreutils release that included this was in 2012. Since then, systemd requires a newer meson, mostly uses install_symlink, and so on. Additionally, where it does use this feature, it uses the '-r' short flag. There are implementations of 'ln' that do have support for '-r' but no longopts. Things will still work on those but this check will fail. --- meson.build | 4 ---- 1 file changed, 4 deletions(-) diff --git a/meson.build b/meson.build index b4066e04f8..7fb845622d 100644 --- a/meson.build +++ b/meson.build @@ -659,10 +659,6 @@ foreach prog : progs conf.set_quoted(name, path) endforeach -if run_command(ln, '--relative', '--help', check : false).returncode() != 0 - error('ln does not support --relative (added in coreutils 8.16)') -endif - ##################################################################### gperf_test_format = ''' From 57f911973ae5e9936fdfae994db6c900ef051c91 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 6 Dec 2025 17:55:04 +0100 Subject: [PATCH 2/4] 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 From abf73cb072ff437a8778a1adf915ff9ae5f5fc85 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 6 Dec 2025 17:56:47 +0100 Subject: [PATCH 3/4] 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. --- meson.build | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index 8d312dd70c..547543b9c5 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, From 3d64cb9a543d4dd44836bc4fde9d5e58af8f2c75 Mon Sep 17 00:00:00 2001 From: q66 Date: Sat, 6 Dec 2025 17:59:09 +0100 Subject: [PATCH 4/4] vcs-tag.sh: use portable sed argument order --- tools/vcs-tag.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/vcs-tag.sh b/tools/vcs-tag.sh index faec440f6b..a53b4efbd7 100755 --- a/tools/vcs-tag.sh +++ b/tools/vcs-tag.sh @@ -8,7 +8,7 @@ ENABLED="$3" if ! ((ENABLED)) || ! [[ -d .git ]] || ! command -v git >/dev/null || git describe --tags --exact-match &>/dev/null then - sed "$INPUT" -e "s/@VCS_TAG@//" + sed -e "s/@VCS_TAG@//" "$INPUT" exit 0 fi @@ -20,4 +20,4 @@ fi TAG="-g$(git describe --abbrev=7 --match="" --always $DIRTY)" -sed "$INPUT" -e "s/@VCS_TAG@/$TAG/" +sed -e "s/@VCS_TAG@/$TAG/" "$INPUT"