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

-- 
Vladi Belperchinov-Shabanski <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Personal home page at http://www.biscom.net/~cade
DataMax Ltd. http://www.datamax.bg
Too many hopes and dreams won't see the light...

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to