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)
Sun, Nov 10, 12:08 PM
Unknown Object (File)
Sun, Nov 10, 12:08 PM
Unknown Object (File)
Thu, Nov 7, 5:19 AM
Unknown Object (File)
Thu, Oct 17, 2:23 PM
Unknown Object (File)
Tue, Oct 15, 7:31 PM
Unknown Object (File)
Oct 12 2024, 7:41 AM
Unknown Object (File)
Oct 11 2024, 12:15 AM
Unknown Object (File)
Oct 9 2024, 2:52 AM
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.