DragonFly kernel List (threaded) for 2007-09
DragonFly BSD
DragonFly kernel List (threaded) for 2007-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

mirror CGI test


From: "Justin C. Sherrill" <justin@xxxxxxxxxxxxxxxxxx>
Date: Sat, 22 Sep 2007 00:01:47 -0400 (EDT)

To follow up on the mirror idea...

Here's a quick draft for a CGI that would accept HTTP (haven't tried FTP
URLs yet) requests for pkgsrc packages and direct them to a random mirror,
pasted below.  In testing, pkg_add works with it, either as a directly
passed URL or if you set PKG_PATH.  BINPKG_SITES does not work for 'bmake
bin-install' targets, because it unhelpfully assumes it needs to add /All
onto the target URL.

#!/usr/pkg/bin/perl

@mirrors = (
"http://www.pkgsrc-box.org/packages/stable/DragonFly-1.10/All";,
"http://chlamydia.fs.ei.tum.de/pub/DragonFly/packages/stable/DragonFly-1.10/All";,
     
"http://www.theshell.com/pub/DragonFly/packages/stable/DragonFly-1.10/All";,
      
"http://ftp.twaren.net/BSD/DragonFlyBSD/packages/stable/DragonFly-1.10/All";,
);

my $target = $ENV{'REQUEST_URI'};
$target =~ s/^\/download//;

print "Location: " . $mirrors[int(rand(scalar(@mirrors)))] . "$target\n\n";





[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]