summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-31 12:59:52 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-10-31 12:59:52 +0000
commit38033c3f1b3089774c321cead65c6031c650e96c (patch)
treeda8e12ee38a7598cfe041256d68ece990059cb29 /urpm.pm
parent648f4d5a5290edd34d0e2a3a1371d8c758bd84bf (diff)
downloadurpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar
urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar.gz
urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar.bz2
urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar.xz
urpmi-38033c3f1b3089774c321cead65c6031c650e96c.zip
Simplify code, change obscure error message
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/urpm.pm b/urpm.pm
index db1c0ddd..ce465a71 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -251,11 +251,12 @@ sub probe_medium {
my ($urpm, $medium, %options) = @_;
local $_;
- my $existing_medium;
foreach (@{$urpm->{media}}) {
- $_->{name} eq $medium->{name} and $existing_medium = $_, last;
+ if ($_->{name} eq $medium->{name}) {
+ $urpm->{error}(N("trying to override existing medium \"%s\", skipping", $medium->{name}));
+ return;
+ }
}
- $existing_medium and $urpm->{error}(N("trying to bypass existing medium \"%s\", avoiding", $medium->{name})), return;
$medium->{url} ||= $medium->{clear_url};