From 30d7067c0fd184956ca5f866e7903c6fa241717f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Mon, 21 Feb 2005 09:57:49 +0000 Subject: Factorize out the code that handles /etc/urpmi/mirror.config --- urpm/cfg.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'urpm/cfg.pm') diff --git a/urpm/cfg.pm b/urpm/cfg.pm index 815a992a..f5186e23 100644 --- a/urpm/cfg.pm +++ b/urpm/cfg.pm @@ -217,6 +217,24 @@ sub dump_config ($$) { return 1; } +#- routines to handle mirror list location + +#- Default mirror list +our $mirrors = 'http://www.mandrakelinux.com/mirrorsfull.list'; + +sub mirrors_cfg () { + if (-e "/etc/urpmi/mirror.config") { + local $_; + open my $fh, "/etc/urpmi/mirror.config" or return undef; + while (<$fh>) { + chomp; s/#.*$//; s/^\s*//; s/\s*$//; + /^url\s*=\s*(.*)/ and $mirrors = $1; + } + close $fh; + } + return 1; +} + 1; __END__ -- cgit v1.2.1