[tz] Detecting a new release

Ian Abbott abbotti at mev.co.uk
Fri Aug 3 10:57:26 UTC 2012


On 2012-08-03 10:58, Neil Masson wrote:
> This might have been talked about recently, but I don't remember any
> resolution.
>
> I have a script which polls the IANA Website daily to detect if there
> has been any update.  It parses the html to find the latest version and
> then checks to see if the version has changed since the last time.  This
> solution is fragile and could easily be broken if the layout of the
> Website changes.
>
> I don't see any way of detecting the version from the ftp or rsync sites
> as the "real" filename which contains the version has been replaced with
> a link tzdata-latest.tar.gz.

You could parse the output of lftp or ncftpls in long-listing mode:

$ lftp -c 'open ftp://ftp.iana.org/tz/; ls'
-rw-r--r--    1 49       49            129 Apr 16 21:25 README
drwxr-xr-x    2 49       49           4096 Aug 03 04:08 code
drwxr-xr-x    2 49       49           4096 Aug 03 04:08 data
drwxr-xr-x    2 49       49          20480 Aug 03 04:08 releases
lrwxrwxrwx    1 49       49             16 Jul 20 00:22 tz-link.html -> 
code/tz-link.htm
lrwxrwxrwx    1 49       49             27 Aug 03 04:28 
tzcode-latest.tar.gz -> releases/tzcode2012e.tar.gz
lrwxrwxrwx    1 49       49             27 Aug 03 04:28 
tzdata-latest.tar.gz -> releases/tzdata2012e.tar.gz

$ ncftpls -l ftp://ftp.iana.org/tz/
-rw-r--r--    1 49       49            129 Apr 16 21:25 README
drwxr-xr-x    2 49       49           4096 Aug 03 04:08 code
drwxr-xr-x    2 49       49           4096 Aug 03 04:08 data
drwxr-xr-x    2 49       49          20480 Aug 03 04:08 releases
lrwxrwxrwx    1 49       49             16 Jul 20 00:22 tz-link.html -> 
code/tz-link.htm
lrwxrwxrwx    1 49       49             27 Aug 03 04:28 
tzcode-latest.tar.gz -> releases/tzcode2012e.tar.gz
lrwxrwxrwx    1 49       49             27 Aug 03 04:28 
tzdata-latest.tar.gz -> releases/tzdata2012e.tar.gz

-- 
-=( Ian Abbott @ MEV Ltd.    E-mail: <abbotti at mev.co.uk>        )=-
-=( Tel: +44 (0)161 477 1898   FAX: +44 (0)161 718 3587         )=-



More information about the tz mailing list