diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-14 11:56:08 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-14 11:56:08 +0000 |
commit | 32ffdc982ae393decec84fc985f62c8de1aa1453 (patch) | |
tree | eb5489eb699d042ceb902e09fcb86def74f30994 /urpm.pm | |
parent | 92d4fd2cde8be670e5afed1758897f9468711180 (diff) | |
download | urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar.gz urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar.bz2 urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar.xz urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.zip |
rewrite a little
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -241,15 +241,22 @@ sub read_config { } #- check the presence of hdlist and list files if necessary. - unless ($options{nocheck_access}) { - foreach (@{$urpm->{media}}) { - $_->{ignore} and next; - -r "$urpm->{statedir}/$_->{hdlist}" || -r "$urpm->{statedir}/synthesis.$_->{hdlist}" && $_->{synthesis} - or $_->{ignore} = 1, - $urpm->{error}(N("unable to access hdlist file of \"%s\", medium ignored", $_->{name})); - $_->{list} && -r "$urpm->{statedir}/$_->{list}" || defined $_->{url} - or $_->{ignore} = 1, - $urpm->{error}(N("unable to access list file of \"%s\", medium ignored", $_->{name})); + if (!$options{nocheck_access}) { + foreach my $medium (@{$urpm->{media}}) { + $medium->{ignore} and next; + + if (-r "$urpm->{statedir}/$medium->{hdlist}") {} + elsif ($medium->{synthesis} && -r "$urpm->{statedir}/synthesis.$medium->{hdlist}") {} + else { + $medium->{ignore} = 1; + $urpm->{error}(N("unable to access hdlist file of \"%s\", medium ignored", $medium->{name})); + } + if ($medium->{list} && -r "$urpm->{statedir}/$medium->{list}") {} + elsif ($medium->{url}) {} + else { + $medium->{ignore} = 1; + $urpm->{error}(N("unable to access list file of \"%s\", medium ignored", $medium->{name})); + } } } |