From 39093d7cdd662d17f5177c804c944f82d8639113 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 6 Apr 2007 23:15:39 +0000 Subject: 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 --- scripts/download.pl | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) (limited to 'scripts') diff --git a/scripts/download.pl b/scripts/download.pl index 280e5f0d7..543dcc187 100755 --- a/scripts/download.pl +++ b/scripts/download.pl @@ -21,13 +21,24 @@ my $ok; @ARGV > 0 or die "Syntax: $0 [ ...]\n"; sub localmirrors { - my @mlist; - open LM, "$scriptdir/localmirrors" or return (); - while () { - chomp $_; - push @mlist, $_; - } + open LM, "$scriptdir/localmirrors" and do { + while () { + chomp $_; + push @mlist, $_; + } + close LM; + }; + open CONFIG, "<".$ENV{'TOPDIR'}."/.config" and do { + while () { + /^CONFIG_LOCALMIRROR="(.+)"/ and do { + chomp; + push @mlist, $1; + }; + } + close CONFIG; + }; + return @mlist; } -- cgit v1.2.3