Page MenuHomeFreeBSD

tzsetup: add support for countries in two continents
ClosedPublic

Authored by khorben on Aug 3 2023, 8:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 25, 2:10 PM
Unknown Object (File)
Mon, Nov 3, 8:26 PM
Unknown Object (File)
Fri, Oct 31, 12:26 PM
Unknown Object (File)
Thu, Oct 30, 4:11 AM
Unknown Object (File)
Wed, Oct 29, 2:55 PM
Unknown Object (File)
Wed, Oct 29, 12:11 PM
Unknown Object (File)
Wed, Oct 29, 11:53 AM
Unknown Object (File)
Wed, Oct 29, 11:53 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 Skipped
Unit
Tests Skipped

Event Timeline

This looks reasonable overall

usr.sbin/tzsetup/tzsetup.c
281

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

475–477

might be worth a switch now that we have 3 cases

This comment was removed by khorben.
  • Renamed the new member of struct country
  • Use a switch/case for pass 1 to 3
khorben 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.

This revision was automatically updated to reflect the committed changes.