summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm22
1 files changed, 12 insertions, 10 deletions
diff --git a/urpm.pm b/urpm.pm
index 7d274db2..cb83069b 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -223,17 +223,19 @@ sub read_config {
#- remember if an hdlist or list file is already used
my %filelists;
- foreach (@{$urpm->{media}}) {
+ foreach my $medium (@{$urpm->{media}}) {
foreach my $filetype (qw(hdlist list)) {
- if ($_->{$filetype}) {
- exists($filelists{$filetype}{$_->{$filetype}})
- and $_->{ignore} = 1,
- $urpm->{error}(
- $filetype eq 'hdlist'
- ? N("medium \"%s\" trying to use an already used hdlist, medium ignored", $_->{name})
- : N("medium \"%s\" trying to use an already used list, medium ignored", $_->{name})
- );
- $filelists{$filetype}{$_->{$filetype}} = undef;
+ $medium->{$filetype} or next;
+
+ if ($filelists{$filetype}{$medium->{$filetype}}) {
+ $medium->{ignore} = 1;
+ $urpm->{error}(
+ $filetype eq 'hdlist'
+ ? N("medium \"%s\" trying to use an already used hdlist, medium ignored", $medium->{name})
+ : N("medium \"%s\" trying to use an already used list, medium ignored", $medium->{name})
+ );
+ } else {
+ $filelists{$filetype}{$medium->{$filetype}} = 1;
}
}
}