summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-14 11:44:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-14 11:44:54 +0000
commit92d4fd2cde8be670e5afed1758897f9468711180 (patch)
treeaacb33d8660162037a29ecbb8b56a5732ce1612f
parent491e4c789ebc4dd957aa516dae68bc18df905b09 (diff)
downloadurpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar
urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar.gz
urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar.bz2
urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar.xz
urpmi-92d4fd2cde8be670e5afed1758897f9468711180.zip
simplify
-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;
}
}
}