[tz] version information in tz binary file?

Alan Barrett apb at cequrux.com
Mon Sep 9 07:11:30 UTC 2013


On Sun, 08 Sep 2013, Paul Eggert wrote:
> One other thing.  It's been privately suggested to me, more 
> than once, that a tz binary file should have a version number 
> in it, identifying which version of the tz data it came 
> from.  Presumably this could be a new option to 'zic', used by 
> Makefile, e.g.,
>
> zic -V "$(VERSION)" ...
>
> would copy the value of VERSION into the zic output file.

I'd like that.  It's useful to be able to tell somebody "run this 
command to check whether your system contains the new rules for 
your location", and to have the command be something simple like a 
variant of zdump that just prints the version.

I'd also like the binary file to contain a string giving the zone 
name.  This would permit a simple automated answer to the question 
of which binary file has been copied to /etc/localtime (or 
whatever file defines the default time zone on the local system).  
In the case of links, multiple files would share the same embedded 
name, but I think that's OK.

> Do you think this is a good idea?  If so, where would be a good 
> place to put the version information -- a new "version=2013e" 
> line after the POSIX TZ string?

I suggest a new list of variable=value strings, with version=.... 
and name=... being the first two such strings.  If done carefully, 
additional strings could be added later without needing to bump 
{struct tzhead}.tzh_version again.

We should probably also start thinking about what to do when 
tzh_version reaches '9'.

--apb (Alan Barrett)




More information about the tz mailing list