summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-18 13:55:31 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-18 13:55:31 +0000
commit17100661516bbc5d2f6d466ae01637402a70167c (patch)
tree3d0b03029f9d5b3fd21413c3581cc422d1fde0ea /urpm
parented0e1f07de9e3f52f20c29c0d2e34de5f9ba9cce (diff)
downloadurpmi-17100661516bbc5d2f6d466ae01637402a70167c.tar
urpmi-17100661516bbc5d2f6d466ae01637402a70167c.tar.gz
urpmi-17100661516bbc5d2f6d466ae01637402a70167c.tar.bz2
urpmi-17100661516bbc5d2f6d466ae01637402a70167c.tar.xz
urpmi-17100661516bbc5d2f6d466ae01637402a70167c.zip
create _expand() out of _list()
Diffstat (limited to 'urpm')
-rw-r--r--urpm/mirrors.pm17
1 files changed, 11 insertions, 6 deletions
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index 8d39c897..3bde1837 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -133,17 +133,22 @@ sub _save_cache {
sub _list {
my ($urpm, $mirrorlist) = @_;
+ my @mirrors = _mirrors_filtered($urpm, _expand($mirrorlist));
+ add_proximity_and_sort($urpm, \@mirrors);
+ @mirrors;
+}
+
+sub _expand {
+ my ($mirrorlist) = @_;
+
# expand the variables
+
if ($mirrorlist eq '$MIRRORLIST') {
- $mirrorlist = _MIRRORLIST();
+ _MIRRORLIST();
} else {
require urpm::cfg;
- $mirrorlist = urpm::cfg::expand_line($mirrorlist);
+ urpm::cfg::expand_line($mirrorlist);
}
-
- my @mirrors = _mirrors_filtered($urpm, $mirrorlist);
- add_proximity_and_sort($urpm, \@mirrors);
- @mirrors;
}
#- side-effects: $mirrors