Page MenuHomeFreeBSD

tzsetup: add support for countries in two continents
ClosedPublic

Authored by khorben_defora.org on Aug 3 2023, 8:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Apr 29, 12:44 PM
Unknown Object (File)
Mon, Apr 29, 12:44 PM
Unknown Object (File)
Feb 8 2024, 11:51 AM
Unknown Object (File)
Jan 31 2024, 5:52 PM
Unknown Object (File)
Dec 31 2023, 1:09 AM
Unknown Object (File)
Dec 20 2023, 7:48 AM
Unknown Object (File)
Dec 13 2023, 10:59 PM
Unknown Object (File)
Dec 10 2023, 5:23 PM
Subscribers

Details

Summary

This supports countries located across multiple continents, as per the zone1970.tab file. This only affects Cyprus and Türkiye at the moment.

The patch only handles a single extra continent, even though the file format supports multiple ones; in practice this capability is not used in zone1970.tab as of today. Therefore I believe this change is a net positive for now, as it fixes an issue reported by a user from Cyprus.

PR: #236874
Sponsored by: The FreeBSD Foundation

Test Plan
$ make buildenv
$ cd usr.sbin/tzsetup
$ make
$ /usr/obj/usr/src/usr.sbin/tzsetup/tzsetup
[browse through Asia and Europe, both should list Cyprus and Türkiye]

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This looks reasonable overall

usr.sbin/tzsetup/tzsetup.c
279

"extra" continent isn't obvious to me -- maybe "alternate"?

473–475

might be worth a switch now that we have 3 cases

  • Renamed the new member of struct country
  • Use a switch/case for pass 1 to 3
khorben_defora.org marked 2 inline comments as done.
This revision is now accepted and ready to land.Aug 30 2023, 6:23 PM

I fetched this from your branch but it still has struct continent *extra; /* extra continent */ (not alternate), please refresh.