From 347bed4dabce6d686b7dd9ee3a5bd3b6a9d8c9e1 Mon Sep 17 00:00:00 2001 From: pavlov Date: Wed, 24 Jan 2007 22:38:02 +0000 Subject: [PATCH] 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 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6192 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- scripts/download.pl | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/download.pl b/scripts/download.pl index 859e6c8ba..51340097d 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -8,16 +8,30 @@ use strict; use warnings; +use File::Basename; my $target = shift @ARGV; my $filename = shift @ARGV; my $md5sum = shift @ARGV; +my $scriptdir = dirname($0); my @mirrors; my $ok; @ARGV > 0 or die "Syntax: $0 [ ...]\n"; +sub localmirrors { + + my @mlist; + open LM, "$scriptdir/localmirrors" or return ""; + while () { + chomp $_; + push @mlist, $_; + } + + return @mlist; +} + sub which($) { my $prog = shift; my $res = `which $prog`; @@ -78,6 +92,8 @@ sub cleanup unlink "$target/$filename.md5sum"; } +@mirrors = localmirrors(); + foreach my $mirror (@ARGV) { if ($mirror =~ /^\@SF\/(.+)$/) { # give sourceforge a few more tries, because it redirects to different mirrors -- 2.35.1