httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Magnus Bodin <mag...@bodin.org>
Subject [CORRECTION/PATCH] Re: fetch-from-cvs-script revisited
Date Wed, 28 Jul 1999 05:35:53 GMT
On Tue, 27 Jul 1999, Chris Costello wrote:

> On Tue, Jul 27, 1999, Magnus Bodin wrote:
> > On Tue, 03 Feb 1998 Doug MacEachern wrote:
> > 
> > > This script will fetch the latest tarball in from-cvs/ and unpack it
> > > in $dir I posted it a few months ago, maybe it should be made
> > > available somewhere on dev.apache.org?
> > 
> > Regarding Doug MacEacherns script at
> >    http://dev.apache.org/fetch-from-cvs.txt
> > 
> > I would propose that it is replaced with this changed version.
> > I now works (as the directory structure, link names etc has changed)
> > again. It also features easy change of version.
> 
>    I've written a simpler shell script to fetch it.  Note that
> the script from dev.apache.org seems not to work properly for me
> (I'll try the new version in a minute).  I'm aware it's not
> absolutely portable due to lynx and fetch, but here's what I've
> written:
>
> [yada yada]


My point was that the one that resides on dev.apache.org DOESN'T WORK.
THIS DO. It does exactly what dougs original script did before
directories, links and names changed.

At least put this corrected one up, please. 
Someone who has taz-access, that is. 

/magnus


-- %< --- cut here --------- %< ---------------------
#!/usr/bin/perl -w
# Script by Doug MacEachern <dougm@telebusiness.co.nz>
# minor fix by Magnus Bodin <magnus@bodin.org>

use strict;
use URI::URL ();
use HTML::LinkExtor ();
use LWP::Simple;
use File::Path;

my $ver = '1.3';
my $dir = shift || "/tmp/apache_$ver-dev";
my $cvs = "http://dev.apache.org/from-cvs/apache-$ver/";
my $filptn = "apache-$ver\_"; 

rmtree $dir;
mkpath $dir, 0755;

chdir $dir;

my $p = HTML::LinkExtor->new(\&cb, $cvs);
my $cnt;

sub cb {
    my($tag, %links) = @_;
    return unless exists $links{href} and $links{href} =~ /$fileptn/;
    return unless ++$cnt == 4;

    my $file = URI::URL->new($links{href})->rel($cvs);
    warn "mirror $links{href} => $file\n";

    mirror $links{href} => $file;
    system "gunzip < $file | tar -xvf -";
    unlink $file;
}

$p->parse(get $cvs);


Mime
View raw message