diff options
author | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-04-06 23:15:39 +0000 |
---|---|---|
committer | nbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2007-04-06 23:15:39 +0000 |
commit | 39093d7cdd662d17f5177c804c944f82d8639113 (patch) | |
tree | f75a0eb955383e7939629df85aab6daf95233187 /scripts | |
parent | 4c55426589d138ebc24d9cbebe3094df0424d93d (diff) |
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
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/download.pl | 23 |
1 files changed, 17 insertions, 6 deletions
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 <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; } |