diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-03-18 13:55:31 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-03-18 13:55:31 +0000 |
commit | 17100661516bbc5d2f6d466ae01637402a70167c (patch) | |
tree | 3d0b03029f9d5b3fd21413c3581cc422d1fde0ea /urpm | |
parent | ed0e1f07de9e3f52f20c29c0d2e34de5f9ba9cce (diff) | |
download | urpmi-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.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 |