diff options
-rw-r--r-- | urpm/mirrors.pm | 17 |
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 |