Keeping /etc/localtime up-to-date
Tim Kientzle
tim at kientzle.com
Mon Mar 28 02:12:15 UTC 2011
On Mar 27, 2011, at 1:31 PM, Doug Barton wrote:
> On 03/27/2011 08:38, David Wolfskill wrote:
>> So it seems to me that requirements would be:
>> * The content of /etc/localtime must provide the appropriate
>> "zoneinfo" information, even when/usr/share/zoneinfo/* has been
>> modified (or shortly thereafter, in concert with "make installworld").
>
> This is more along the lines of something that would be easy to work with in mergemaster. If I can tell what file in /usr/share/zoneinfo to compare /etc/localtime to (ideally with fully path), I'm happy to provide a mechanism in mergemaster to make sure it stays up to date.
The best fix is to first add the ability for date(1)
to print out the current timezone name.
(E.g., "America/Los_Angeles") Then it's trivial
for mergemaster to update /etc/localtime; just
ask date(1) for the timezone name and copy
the correct one over /etc/localtime.
Unfortunately, I think it's currently impossible
for date(1) to do this because the zoneinfo
files don't store that information. This is the real
reason Solaris uses a symlink; the value of the
symlink gives you the timezone name.
FWIW, mergemaster is not the only program
that would benefit from a canonical way to obtain
the name of the current timezone.
Cheers,
Tim
More information about the freebsd-hackers
mailing list