Merge pull request #2924 from testssl/date_fix_rust-date.3.2

Fix date for Ubuntu >= 25.10 (3.2)
This commit is contained in:
Dirk Wetter
2025-10-12 20:17:09 +02:00
committed by GitHub

View File

@@ -470,10 +470,14 @@ HAS_FREEBSDDATE=false
HAS_OPENBSDDATE=false HAS_OPENBSDDATE=false
if date -d @735275209 >/dev/null 2>&1; then 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
# Ubuntu >= 25.10
HAS_GNUDATE=true
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
# It can't do any conversion from a plain date output. # It can't do any conversion from a plain date output.
HAS_OPENBSDDATE=true HAS_OPENBSDDATE=true
else
HAS_GNUDATE=true
fi fi
fi fi
# FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6. # FreeBSD and OS X date(1) accept "-f inputformat", so do newer OpenBSD versions >~ 6.6.