Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version

From: Magnus Hagander <magnus(at)hagander(dot)net>
To: Dave Page <dpage(at)postgresql(dot)org>
Cc: Andrew Hammond <andrew(dot)george(dot)hammond(at)gmail(dot)com>, CAJ CAJ <pguser(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org, pgsql-www <pgsql-www(at)postgresql(dot)org>
Subject: Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version
Date: 2007-04-10 08:15:58
Message-ID: 20070410081558.GB24976@svr2.hagander.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-www

On Tue, Apr 10, 2007 at 08:36:10AM +0100, Dave Page wrote:
> Andrew Hammond wrote:
> > On 4/9/07, CAJ CAJ <pguser(at)gmail(dot)com> wrote:
> >> On 9 Apr 2007 14:47:20 -0700, Andrew Hammond
> >> <andrew(dot)george(dot)hammond(at)gmail(dot)com> wrote:
> >> > I'm writing a script that wants to know the latest release for a given
> >> > major.minor version. Is there some better way than parsing
> >> > http://www.postgresql.org/ftp/source/ or trying to
> >> connect to ftp
> >> > (which is invariably timing out on me today. Is that box getting
> >> > hammered or something?) and doing the parsing that? Both approaches
> >> > feel quite awkward to me.
> >>
> >> Use wget to download via HTTP (added recently). Probably wise to add a
> >> couple mirrors in your script.
> >
> > I'm not asking how to download stuff. I'm asking how to figure out the
> > current release number for a given major.minor. I thought that was
> > clear in my original post, but I guess not. For example, how do I
> > determine (programmatically) the lastest version of 8.1.
>
> Currently you can't without parsing pages.

I've been meaning to do this for a while now, and I guess this might be a
good motivator ;-) The idea would, of course, be to build this from a set of
common data with the frontpage of the website, so they're always in sync.
As I see it, there are basically three ways of doing it:

1) Fold it into mirrors.xml. That's going to be a bit hard given how the
schema is (since the root element is mirror), but it would work. Another
downside is that is that people who just want to check the latest version
will have to pull down the whole mirror list file. This file is also
rewritten often, so checks on If-Modified-Since will fail.

2) Create a new file with a specific schema. Something like:
<version>
<version major="8.2" minor="8.2.3" />
<version major="8.1" minor="8.1.8" />
</version>
This is the most lightweight solution.

3) Use RSS format. Not exactly sure how it would look, but it can certainly
be done in RSS...

I think I prefer option 2, but what do others think?

//Magnus

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2007-04-10 08:52:52 Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version
Previous Message Alban Hertroys 2007-04-10 08:04:37 Re: No of triggers of one single table

Browse pgsql-www by date

  From Date Subject
Next Message Dave Page 2007-04-10 08:52:52 Re: [GENERAL] programmatic way to fetch latest release for a given major.minor version
Previous Message Dave Page 2007-04-10 07:36:10 Re: programmatic way to fetch latest release for a given major.minor version