[tz] [Patch] Make it slightly easier to parse tzdata

Paul Eggert eggert at cs.ucla.edu
Sat Nov 1 20:24:34 UTC 2014


Brian Inglis wrote:
> This would require a tradeoff between the compiled sizes of the
> decompressors on your platform and the compressed data:
>   94K tz.tar.xz

We can shrink it even further than that, as follows:

   files='
     africa antarctica asia australasia
     europe northamerica southamerica
   '
   sed '
     s/#.*//
     s/^/ /
     s/$/ /
     s/\([^0-9]\)0*\([0-9]\)/\1\2/g
     s/:0\([^0-9:]\)/\1/g
     s/[[:blank:]]\{1,\}/ /g
     s/ $//
     s/^ //
     /^$/d
   ' $files |
   lzip

That is, before compressing, omit backward-compatibility material, commentary, 
and unnecessary white space and zeros.  On my platform, the above command 
outputs 21,831 bytes total.



More information about the tz mailing list