From owner-freebsd-hackers@FreeBSD.ORG  Mon Mar 28 02:12:15 2011
Return-Path: <owner-freebsd-hackers@FreeBSD.ORG>
Delivered-To: hackers@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 35FBA1065672;
	Mon, 28 Mar 2011 02:12:15 +0000 (UTC)
	(envelope-from tim@kientzle.com)
Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com
	[209.85.210.182])
	by mx1.freebsd.org (Postfix) with ESMTP id EA4428FC0C;
	Mon, 28 Mar 2011 02:12:14 +0000 (UTC)
Received: by iyj12 with SMTP id 12so3924751iyj.13
	for <multiple recipients>; Sun, 27 Mar 2011 19:12:13 -0700 (PDT)
Received: by 10.42.134.131 with SMTP id l3mr5682791ict.412.1301276948622;
	Sun, 27 Mar 2011 18:49:08 -0700 (PDT)
Received: from [192.168.2.119] (99-74-169-43.lightspeed.sntcca.sbcglobal.net
	[99.74.169.43])
	by mx.google.com with ESMTPS id wo15sm2462629icb.4.2011.03.27.18.49.06
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sun, 27 Mar 2011 18:49:07 -0700 (PDT)
Mime-Version: 1.0 (Apple Message framework v1082)
Content-Type: text/plain; charset=us-ascii
From: Tim Kientzle <tim@kientzle.com>
In-Reply-To: <4D8F9E9A.50604@FreeBSD.org>
Date: Sun, 27 Mar 2011 18:49:04 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <102B99D4-7D9B-43D5-9512-58EFA2EFB637@kientzle.com>
References: <20110327153835.GA87420@albert.catwhisker.org>
	<4D8F9E9A.50604@FreeBSD.org>
To: Doug Barton <dougb@freebsd.org>
X-Mailer: Apple Mail (2.1082)
Cc: hackers@freebsd.org, David Wolfskill <david@catwhisker.org>
Subject: Re: Keeping /etc/localtime up-to-date
X-BeenThere: freebsd-hackers@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: Technical Discussions relating to FreeBSD
	<freebsd-hackers.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>, 
	<mailto:freebsd-hackers-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-hackers>
List-Post: <mailto:freebsd-hackers@freebsd.org>
List-Help: <mailto:freebsd-hackers-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-hackers>,
	<mailto:freebsd-hackers-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 28 Mar 2011 02:12:15 -0000

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").
>=20
> 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