diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-31 12:59:52 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-10-31 12:59:52 +0000 |
commit | 38033c3f1b3089774c321cead65c6031c650e96c (patch) | |
tree | da8e12ee38a7598cfe041256d68ece990059cb29 | |
parent | 648f4d5a5290edd34d0e2a3a1371d8c758bd84bf (diff) | |
download | urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar.gz urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar.bz2 urpmi-38033c3f1b3089774c321cead65c6031c650e96c.tar.xz urpmi-38033c3f1b3089774c321cead65c6031c650e96c.zip |
Simplify code, change obscure error message
-rw-r--r-- | urpm.pm | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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}; |