httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@engelschall.com (Ralf S. Engelschall)
Subject Re: autograb latest from dev/from-cvs
Date Thu, 19 Mar 1998 07:18:55 GMT

In article <Pine.BSF.3.95q.980318115618.25933L-100000@valis.worldgate.com> you wrote:

> I want to grab the latest tarball automatically from /from-cvs/.  The
> easiest way would be to be able to predict the filename.  Right now you
> can't do that.  

> Suggestions?  Making a symlink to a fixed name is fine except that it
> means anything mirroring (unless it uses ftp) would take two copies.

I used the following script under FreeBSD for this task in the past.  It uses
the ftpget from Squid and NCFTP but both can be substituted simply.

#!/sw/bin/perl
##
##  getsnap -- get Apache development source snapshot
##  Copyright (c) 1997 Ralf S. Engelschall, All Rights Reserved. 
##

$tmpfile = "/tmp/ftpget.ls.$$";

print "Retrieving snapshot information... ";
system("ftpget $tmpfile dev.apache.org /httpd/from-cvs/ A ftp rse\@engelschall.com >$tmpfile");
print "Done\n";

open(FP, "<$tmpfile");
$last = "";
while (<FP>) {
    $last = $_ if (m|apache_.*\.tar\.gz|);
}
close(FP);
$last =~ m|.* ([^ ]+)\r\n$|;
$file = $1;
print "Latest Snapshot: $file\n";

print "Retrieving snapshot tarball... ";
system("ncftp ftp://dev.apache.org/httpd/from-cvs/$file");
print "Done\n";

print "Converting snapshot package... ";
system("gunzip <$file | tardy -Prefix apache_1.3b-dev | gzip -9 >apache_1.3b-dev.tar.gz");
system("rm $file");
print "Done\n";

system("rm $tmpfile");

                                       Ralf S. Engelschall
                                       rse@engelschall.com
                                       www.engelschall.com

Mime
View raw message