summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTim Yardley <lst@openwrt.org>2007-01-24 22:38:02 +0000
committerTim Yardley <lst@openwrt.org>2007-01-24 22:38:02 +0000
commit7ed63d8d91352c286338dd91a332a39555226ebf (patch)
tree6fdd4789082e92996ace3eee3dc608909dc3646e /scripts
parent453e16f56ebde746a2a0cdafce13f8c303de70a6 (diff)
downloadmtk-20170518-7ed63d8d91352c286338dd91a332a39555226ebf.zip
mtk-20170518-7ed63d8d91352c286338dd91a332a39555226ebf.tar.gz
mtk-20170518-7ed63d8d91352c286338dd91a332a39555226ebf.tar.bz2
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
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/download.pl16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/download.pl b/scripts/download.pl
index 859e6c8..5134009 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 <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($) {
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