How can I reduce size of zoneinfo compiled binary files?

Dominique Pellé dominique.pelle at gmail.com
Wed Mar 31 20:58:10 UTC 2010


Hi

I'd like to compile the zoneinfo files for an embedded system
where I'd like to strip as much information as possible.

I see that all the zoneinfo binary files take 6.1Mb:

  $ du -s -h /usr/share/zoneinfo/
  6,1M  /usr/share/zoneinfo/

If I run the zic compiler, it produces the following file sizes
for example for Europe/Paris, Europe/Amsterdam, Europe/Berlin:

  $ mkdir -p test
  $ zic -d test europe
  $ ls -l test/Europe/{Paris,Amsterdam,Berlin}
  -rw-r--r-- 1 pel pel 2917 2010-03-31 22:09 test/Europe/Amsterdam
  -rw-r--r-- 1 pel pel 2309 2010-03-31 22:09 test/Europe/Berlin
  -rw-r--r-- 1 pel pel 2945 2010-03-31 22:09 test/Europe/Paris

Since I don't care about time zone rules in the past for my
embedded application, I'd like to compile only the rules starting
at year >= 2010 for example (in other words, I'd like to ignore all
historical rules older than < 2010).  I would then expect output
binary files to become not only smaller, but also many of them
should  also identical since most countries in Europe follow the
same rules nowadays (Europe/Amsterdam, Europe/Berlin and
Europe/Paris in my above example should become identical).
So I should then be able to create links to most of them.

However, I don't see any command line option in the 'zic' compiler
to let me compile rules from >= 2010 only, or am I missing something?

I suppose that I could edit the input ASCII file 'europe', 'asia' (etc)
to remove rules in the past, but it seems error prone (especially
since input text files can be updated regularly).  Is there a simpler
solution?

Thanks
-- Dominique



More information about the tz mailing list