Fix date for Ubuntu >= 25.10

works for
- ubuntu 24.04
- Debian 13
- openbsd 6.6 / 7.x
- macos 15.7.1

Fixes #2909
This commit is contained in:
Dirk Wetter
2025-10-07 23:15:23 +02:00
parent 3ece1e4b11
commit 36bc08ce18

View File

@ -475,10 +475,14 @@ HAS_GNUDATE=false
HAS_FREEBSDDATE=false
HAS_OPENBSDDATE=false
if date -d @735275209 >/dev/null 2>&1; then
if date -r @735275209 >/dev/null 2>&1; then
if date -r 735275209 >/dev/null 2>&1; then
# It can't do any conversion from a plain date output.
HAS_OPENBSDDATE=true
else
elif date -r 735275209 2>&1 | grep -q "No such file"; then
# e.g. Debian 24.04, Debian 11-13
HAS_GNUDATE=true
elif date -r @735275209 >/dev/null 2>&1; then
# Ubuntu >= 25.10
HAS_GNUDATE=true
fi
fi