Messages in this thread | | | Date | Sun, 10 Jan 1999 16:05:29 +0000 (GMT) | From | Riley Williams <> | Subject | Re: latest-only kernel.org mirrors |
| |
Hi Nicholas.
On Sat, 9 Jan 1999, Nicholas J. Leon wrote:
> On Fri, 8 Jan 1999, Riley Williams wrote: > > # Actually, I could create such a mirror quite easily: All it needs is > # for the mirror site to run a script that: > # > # 1. Deletes all except the latest file in each tree. > # > # 2. Mirrors any files created in the last week. > # > > I use the following script to mirror only the latest stuff ....
I've just had a look through it, and it doesn't appear to delete the older stuff that it received when it ran prior to the current run?
> #!/bin/perl > > $|=1; > #$src="ftp://ftp.kernel.org/pub/linux/kernel"; > $src="ftp://katelyn.optilinkcomm.net/pub/linux/kernel"; > $dst="/usr/src/kernels"; > > $patch=0; > > $patch=1 if $ARGV[0] eq "-p"; > > sub makefn { > my $ver=shift; > my $maj; > > $maj=$1 if $ver=~/^(\d+\.\d+)/; > > if ($maj eq "2.2") { > $maj="2.1"; > } > > if ($patch) { > return "v$maj/patch-$ver.bz2"; > } else { > return "v$maj/linux-$ver.tar.bz2"; > } > } > sub makemaj { > my $ver=shift; > my $maj; > > $maj=$1 if $ver=~/^(\d+\.\d+)/; > > return $maj; > } > > > sub get { > my $ver=shift; > my $rem=makefn($ver); > > my $fn; > > if ($patch) { > $fn="$dst/patch-$ver.bz2"; > } > else { > $fn="$dst/linux-$ver.tar.bz2"; > } > > > my $maj=makemaj($ver); > my @ls; > > if ( -f $fn ) { > print "Checking $ver...\n"; > } > else { > if ($patch) { > @ls=<$dst/patch-$maj*.bz2>; > } else { > @ls=<$dst/linux-$maj*.tar.bz2>; > } > print "Getting $src/$rem...\n"; > } > > system("cd $dst;wget -c -m -t 10 -nd $src/$rem") || do { > if (defined @ls) { > unlink @ls; > } > }; > > } > > > open(FINGER,'finger @ftp.kernel.org|') || die; > while (<FINGER>) { > $stable=$1 if /latest stable.+:\s+(.+)/; > $beta=$1 if /latest beta.+:\s+(.+)/; > $alpha=$1 if /latest prepatch.+:\s+(.+)/; > } > close FINGER; > > get $stable; > get $beta; > get $alpha; > > -------------- > > I've been meaning to rewrite this for a while (as far as I'm concerned it > sucks ass for a perl script of mine), but haven't had the time ;) But it > works. > > > G'day! > -- n i c h o l a s j l e o n > elegance through simplicity*http://mrnick.binary9.net*nicholas@binary9.net > good fortune through truth*roaming:njllm@email.msn.com*ICQ#2170994*U+($++) > TRA#6805*not all questions have answers*pseudogeek:P+++($++)L+($++)W=lm@b9 > >
Best wishes from Riley.
--- * ftp://ps.cus.umist.ac.uk/pub/rhw/Linux * http://ps.cus.umist.ac.uk/~rhw/kernel.versions.html
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |