summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
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};