diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-14 11:44:54 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-14 11:44:54 +0000 |
commit | 92d4fd2cde8be670e5afed1758897f9468711180 (patch) | |
tree | aacb33d8660162037a29ecbb8b56a5732ce1612f | |
parent | 491e4c789ebc4dd957aa516dae68bc18df905b09 (diff) | |
download | urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar.gz urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar.bz2 urpmi-92d4fd2cde8be670e5afed1758897f9468711180.tar.xz urpmi-92d4fd2cde8be670e5afed1758897f9468711180.zip |
simplify
-rw-r--r-- | urpm.pm | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -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; } } } |