Hello out there,

thank you for  you replies! In principle this perl script does what I want.
Of course i do not only want to use it for downloading wget-source-packages.
But with a little logic added this script could become a usefull tool for me
(well i  think i have to start improving my perl knowledge).

So thanks once again.

Regards,

Florian

On Wednesday 10 October 2001 13:16, you wrote:
> hi!
>
>   this should do the trick :)
>
> ---cut---
>
> #!/usr/bin/perl
> use strict;
>
> my $url = "http://ibiblio.org/pub/gnu/wget/";;
> my $prog = "wget";
> my $latest = (reverse sort `wget $url -O -` =~ /$prog-([\d\.]+)\.tar\.gz/g
> )[0];
>
> system "wget -c $url$prog-$latest.tar.gz" if $latest;
>
> --cut--
>
> P! Vladi.
>
> Daniel Stenberg wrote:
> > On Wed, 10 Oct 2001, Florian Simnacher wrote:
> > > is it possible to make wget retrieve only the latest version of a given
> > > *.tar.gz source package?
> > >
> > > For example in ftp://ftp.gnu.org/pub/gnu/wget there might be
> > > wget-1.5.tar.gz, wget-1.6.tar.gz, wget-1.7.tar.gz. I would like to
> > > "say" to wget: retrieve wget-someversion.tar.gz and wget fetches only
> > > the latest version (in this example: wget-1.7.tar.gz). And when
> > > wget-1.8.tar.gz is out it will retrieve only this one.
> >
> > This can't possibly be made "built-in".
> >
> > Instead I suggest you do this: Retrieve the directory first, have a
> > script parse it and check for the most recent version present. Check if
> > the most recent one in the remote directory is more recent than the one
> > you have locally and if it is, get it.
> >
> > --
> >       Daniel Stenberg - http://daniel.haxx.se - +46-705-44 31 77
> >    ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol

Reply via email to