From 35967a174c2bbeec5c88897542c6de22a397c67a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Fri, 6 Apr 2007 23:15:39 +0000 Subject: [PATCH] add a menuconfig option for specifying a local download mirror SVN-Revision: 6877 --- Config.in | 3 +++ scripts/download.pl | 23 +++++++++++++++++------ 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 [ ...]\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; }