summaryrefslogtreecommitdiffstats
path: root/urpm/mirrors.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-07-08 20:55:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-07-08 20:55:54 +0000
commit76e1f087e806b7c2104f8785f56e9913403cba3f (patch)
treec70de1ae8452b4e728212081629e9328234e0b1a /urpm/mirrors.pm
parentaa55d788ed9d68828b7eb597b4b2a32edb077672 (diff)
downloadurpmi-76e1f087e806b7c2104f8785f56e9913403cba3f.tar
urpmi-76e1f087e806b7c2104f8785f56e9913403cba3f.tar.gz
urpmi-76e1f087e806b7c2104f8785f56e9913403cba3f.tar.bz2
urpmi-76e1f087e806b7c2104f8785f56e9913403cba3f.tar.xz
urpmi-76e1f087e806b7c2104f8785f56e9913403cba3f.zip
simplify
Diffstat (limited to 'urpm/mirrors.pm')
-rw-r--r--urpm/mirrors.pm10
1 files changed, 4 insertions, 6 deletions
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index cfcc932b..e01c1a68 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -43,17 +43,15 @@ sub pick_one {
sub _pick_one {
my ($urpm, $mirrorlists, $must_succeed, $allow_cache_update) = @_;
- my $url;
my @l = split(' ', $mirrorlists);
foreach my $mirrorlist (@l) {
if (my $cache = _pick_one_($urpm, $mirrorlist, $allow_cache_update)) {
$mirrorlist ne $l[-1] and $cache->{network_mtime} = _network_mtime();
- $url = $cache->{chosen};
- last;
+ return $cache->{chosen};
}
}
- !$url && $must_succeed and $urpm->{fatal}(10, N("Could not find a mirror from mirrorlist %s", $mirrorlists));
- $url;
+ $must_succeed and $urpm->{fatal}(10, N("Could not find a mirror from mirrorlist %s", $mirrorlists));
+ undef;
}
#- side-effects: $urpm->{mirrors_cache}
@@ -124,7 +122,7 @@ sub _cache {
}
sub cache_file {
my ($urpm) = @_;
- my $cache_file = "$urpm->{cachedir}/mirrors.cache";
+ "$urpm->{cachedir}/mirrors.cache";
}
sub _load_cache {
my ($urpm) = @_;