aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2007-04-06 23:15:39 +0000
committerFelix Fietkau <nbd@openwrt.org>2007-04-06 23:15:39 +0000
commitd9e746e0b0e54afc5f21bd03ae4c0e4b56a94771 (patch)
treef75a0eb955383e7939629df85aab6daf95233187
parent36e9ecc72aecce3f6e0f1fff492311b8fb0edeb8 (diff)
downloadmaster-187ad058-d9e746e0b0e54afc5f21bd03ae4c0e4b56a94771.tar.gz
master-187ad058-d9e746e0b0e54afc5f21bd03ae4c0e4b56a94771.tar.bz2
master-187ad058-d9e746e0b0e54afc5f21bd03ae4c0e4b56a94771.zip
add a menuconfig option for specifying a local download mirror
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@6877 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--Config.in3
-rwxr-xr-xscripts/download.pl23
2 files changed, 20 insertions, 6 deletions
diff --git a/Config.in b/Config.in
index 72a3be2b6d..fde72b518e 100644
--- a/Config.in
+++ b/Config.in
@@ -26,6 +26,9 @@ config BROKEN
bool "Show broken platforms / packages" if DEVEL
default n
+config LOCALMIRROR
+ string "Local mirror for source packages" if DEVEL
+
menuconfig BUILDOPTS
bool "Build Options" if DEVEL
diff --git a/scripts/download.pl b/scripts/download.pl
index 280e5f0d73..543dcc1879 100755
--- a/scripts/download.pl
+++ b/scripts/download.pl
@@ -21,13 +21,24 @@ 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, $_;
- }
+ open LM, "$scriptdir/localmirrors" and do {
+ while (<LM>) {
+ chomp $_;
+ push @mlist, $_;
+ }
+ close LM;
+ };
+ open CONFIG, "<".$ENV{'TOPDIR'}."/.config" and do {
+ while (<CONFIG>) {
+ /^CONFIG_LOCALMIRROR="(.+)"/ and do {
+ chomp;
+ push @mlist, $1;
+ };
+ }
+ close CONFIG;
+ };
+
return @mlist;
}