Detecting a new release
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. It would be better if a version file was added to the ftp and rsync sites which contained the version identifier of the release. Neil Masson Unless stated otherwise above: IBM United Kingdom Limited - Registered in England and Wales with number 741598. Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU
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@mev.co.uk> )=- -=( Tel: +44 (0)161 477 1898 FAX: +44 (0)161 718 3587 )=-
O On Aug 3, 2012, at 6:57 AM, Ian Abbott wrote:
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: ...
Or just look at the names of the tarballs to see if a new one showed up. If you sort them lexicographically, ignoring any that have two-digit years, any new one is the last one in that list. I've been using that approach for a while now, it's about 3 lines of Python... paul
i switched Android's script from bash to python last month just to deal with FTP more conveniently: https://android.googlesource.com/platform/bionic/+/5d967e43d03e9c916548b9c29... anyone who's looking for the three[-ish] lines of python can search for 'nlst' in this change: https://android.googlesource.com/platform/bionic/+/5d967e43d03e9c916548b9c29... does anyone have any good ideas about programmatically doing something about verifying the PGP signatures? On Fri, Aug 3, 2012 at 7:28 AM, <Paul_Koning@dell.com> wrote:
O On Aug 3, 2012, at 6:57 AM, Ian Abbott wrote:
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: ...
Or just look at the names of the tarballs to see if a new one showed up. If you sort them lexicographically, ignoring any that have two-digit years, any new one is the last one in that list.
I've been using that approach for a while now, it's about 3 lines of Python...
paul
-- Elliott Hughes - http://who/enh - http://jessies.org/~enh/ NIO or JNI questions? Mail me/drop by/add me as a reviewer.
On Aug 3, 2012, at 3:18 PM, enh wrote:
i switched Android's script from bash to python last month just to deal with FTP more conveniently:
https://android.googlesource.com/platform/bionic/+/5d967e43d03e9c916548b9c29...
anyone who's looking for the three[-ish] lines of python can search for 'nlst' in this change: https://android.googlesource.com/platform/bionic/+/5d967e43d03e9c916548b9c29...
Cool. I don't think you need to retrieve intermediate files, if you're several files behind. Everything is cumulative, so the latest is always sufficient.
does anyone have any good ideas about programmatically doing something about verifying the PGP signatures?
There's python-gnupg and pypgp, both of which look like wrappers around the command line tool. You can do likewise with the Subprocess module, of course. Presumably it could be done with pycrypto, I'm not sure if anyone has already done the legwork. It's probably not hard, but pycrypto is a crypto API, so doing PGP things would mean some extra code on top of that basic API to do the PGP specific processing. paul
On Fri, Aug 3, 2012 at 12:33 PM, <Paul_Koning@dell.com> wrote:
On Aug 3, 2012, at 3:18 PM, enh wrote:
i switched Android's script from bash to python last month just to deal with FTP more conveniently:
https://android.googlesource.com/platform/bionic/+/5d967e43d03e9c916548b9c29...
anyone who's looking for the three[-ish] lines of python can search for
'nlst' in this change: https://android.googlesource.com/platform/bionic/+/5d967e43d03e9c916548b9c29...
Cool.
I don't think you need to retrieve intermediate files, if you're several files behind. Everything is cumulative, so the latest is always sufficient.
i do that for my own benefit, so when people want to know when we last updated some particular zone, i can go through the check-in comments to find out. (sure, a real tool would be better, and checking in the corresponding non-compiled tzdata source files might be a good idea too, but in the absence of that...)
does anyone have any good ideas about programmatically doing something
about verifying the PGP signatures?
There's python-gnupg and pypgp, both of which look like wrappers around the command line tool. You can do likewise with the Subprocess module, of course.
Presumably it could be done with pycrypto, I'm not sure if anyone has already done the legwork. It's probably not hard, but pycrypto is a crypto API, so doing PGP things would mean some extra code on top of that basic API to do the PGP specific processing.
i don't seem to have any of those in my python installation so i'm probably stuck with Subprocess.
On Fri, Aug 3, 2012 at 11:58 AM, Neil Masson <NMASSON@uk.ibm.com> wrote:
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.
Maybe you can poll the unofficial Github repo (presumably Paul will push there close before/after the release). Cheers, Dirkjan
On 08/03/2012 04:28 AM, Dirkjan Ochtman wrote:
Maybe you can poll the unofficial Github repo
I wouldn't rely on the unofficial repo for information about which releases are official. That repo is more likely to contain errors, not only about the time data itself, but also about release information.
participants (6)
-
Dirkjan Ochtman -
enh -
Ian Abbott -
Neil Masson -
Paul Eggert -
Paul_Koning@Dell.com