1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-06-13 10:49:13 +02:00

add functionality to provide local mirrors for development purposes. * any URLs in scripts/localmirrors will be prepended to the mirror list * this facilitates local builds and recompilations * will also be useful for the buildbot and auto-build of images

SVN-Revision: 6192
This commit is contained in:
Tim Yardley 2007-01-24 22:38:02 +00:00
parent 453e16f56e
commit 7ed63d8d91

View File

@ -8,16 +8,30 @@
use strict; use strict;
use warnings; use warnings;
use File::Basename;
my $target = shift @ARGV; my $target = shift @ARGV;
my $filename = shift @ARGV; my $filename = shift @ARGV;
my $md5sum = shift @ARGV; my $md5sum = shift @ARGV;
my $scriptdir = dirname($0);
my @mirrors; my @mirrors;
my $ok; my $ok;
@ARGV > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n"; @ARGV > 0 or die "Syntax: $0 <target dir> <filename> <md5sum> <mirror> [<mirror> ...]\n";
sub localmirrors {
my @mlist;
open LM, "$scriptdir/localmirrors" or return "";
while (<LM>) {
chomp $_;
push @mlist, $_;
}
return @mlist;
}
sub which($) { sub which($) {
my $prog = shift; my $prog = shift;
my $res = `which $prog`; my $res = `which $prog`;
@ -78,6 +92,8 @@ sub cleanup
unlink "$target/$filename.md5sum"; unlink "$target/$filename.md5sum";
} }
@mirrors = localmirrors();
foreach my $mirror (@ARGV) { foreach my $mirror (@ARGV) {
if ($mirror =~ /^\@SF\/(.+)$/) { if ($mirror =~ /^\@SF\/(.+)$/) {
# give sourceforge a few more tries, because it redirects to different mirrors # give sourceforge a few more tries, because it redirects to different mirrors