From Antero Mejr to ~sircmpwn/hare-dev
Sets TZ_LOCAL.name correctly when TZDIR does not end in a slash. Reference: tzset(3) https://man.archlinux.org/man/tzset.3.en tzselect(8) https://man.archlinux.org/man/tzselect.8.en Signed-off-by: Antero Mejr <antero@mailbox.org> --- time/chrono/leapsec.ha | 10 ++++++---- time/chrono/timezone.ha | 9 +++++++-- time/chrono/tzdb.ha | 3 ++- [message trimmed]
From Antero Mejr to ~sircmpwn/hare-dev
/etc/localtime is often a symlink, but may be a TZif file, see tzset(3). Parse the TZif when /etc/localtime is a file. Signed-off-by: Antero Mejr <antero@mailbox.org> --- time/chrono/timezone.ha | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/time/chrono/timezone.ha b/time/chrono/timezone.ha index 52615b35..534338d2 100644 --- a/time/chrono/timezone.ha +++ b/time/chrono/timezone.ha @@ -229,7 +229,7 @@ let TZ_LOCAL: timezone = timezone { case let fp: str => [message trimmed]
From Antero Mejr to ~sircmpwn/hare-dev
Skip tests where the libc implementation-dependent sign bit causes failure. IEEE 754-2008 sec. 6.3: "When either an input or result is NaN, this standard does not interpret the sign of a NaN." Since the tests in question check the sign, they violate the standard. Signed-off-by: Antero Mejr <antero@mailbox.org> --- math/complex/+test.ha | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/math/complex/+test.ha b/math/complex/+test.ha index a1cc0916..d5627853 100644 --- a/math/complex/+test.ha +++ b/math/complex/+test.ha [message trimmed]
From Antero Mejr to ~sircmpwn/hare-dev
This patch handles the case where $TZDIR doesn't end in a forward slash,
resulting in TZ_LOCAL.name incorrectly starting with a forward slash due to
the strings::trimprefix call.
TZDIR reference:
tzselect(8)
https://man.archlinux.org/man/tzselect.8.en
tzset(3)
https://man.archlinux.org/man/tzset.3.en
Current Guix System distribution TZDIR:
/gnu/store/7pjzwj9d4fnyzp9x7k8cc4hazypyrk0p-tzdata-2022a/share/zoneinfo
[message trimmed]
From Antero Mejr to ~sircmpwn/hare-dev
Sebastian <sebastian@sebsite.pw> writes: > This could use os::tryenv: > > os::tryenv("TZDIR", ZONEINFO_PREFIX) I think I forgot to CC you. Updated patch is above, thanks.
From Antero Mejr to ~sircmpwn/hare-dev
Good point, forgot about tryenv. Thanks, Antero Signed-off-by: Antero Mejr <antero@mailbox.org> --- time/chrono/leapsec.ha | 10 ++++++---- time/chrono/timezone.ha | 5 +++-- time/chrono/tzdb.ha | 3 ++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/time/chrono/leapsec.ha b/time/chrono/leapsec.ha index 7706475f..505fb5e7 100644 [message trimmed]
From Antero Mejr to ~sircmpwn/hare-dev
This patch has documentation and moved code around to make more sense. Please ignore the last one, sorry about that. Signed-off-by: Antero Mejr <antero@mailbox.org> --- time/chrono/leapsec.ha | 10 ++++++---- time/chrono/timezone.ha | 17 +++++++++++++++-- time/chrono/tzdb.ha | 3 ++- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/time/chrono/leapsec.ha b/time/chrono/leapsec.ha index 7706475f..7160d392 100644 --- a/time/chrono/leapsec.ha +++ b/time/chrono/leapsec.ha [message trimmed]
From Antero Mejr to ~sircmpwn/hare-dev
This is useful for functional distros (Guix/Nix) and setups where the tz data is in a different place. Signed-off-by: Antero Mejr <antero@mailbox.org> --- time/chrono/leapsec.ha | 21 +++++++++++++++++---- time/chrono/timezone.ha | 5 +++-- time/chrono/tzdb.ha | 3 ++- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/time/chrono/leapsec.ha b/time/chrono/leapsec.ha index 7706475f..39215924 100644 --- a/time/chrono/leapsec.ha +++ b/time/chrono/leapsec.ha [message trimmed]