summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-14 11:56:08 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-14 11:56:08 +0000
commit32ffdc982ae393decec84fc985f62c8de1aa1453 (patch)
treeeb5489eb699d042ceb902e09fcb86def74f30994
parent92d4fd2cde8be670e5afed1758897f9468711180 (diff)
downloadurpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar
urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar.gz
urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar.bz2
urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.tar.xz
urpmi-32ffdc982ae393decec84fc985f62c8de1aa1453.zip
rewrite a little
-rw-r--r--urpm.pm25
1 files changed, 16 insertions, 9 deletions
diff --git a/urpm.pm b/urpm.pm
index cb83069b..3d0708f8 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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}));
+ }
}
}