summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-03-24 18:03:09 +0100
committerMichael Vogt <michael.vogt@ubuntu.com>2011-03-24 18:03:09 +0100
commit43b81f77a6ff557234d7002969cda0e0aa6528cc (patch)
treee0a43fff42de1374890cd7f642ca41de1186db2c
parent4beb315f53061e537b923009e228981bb1e3fa7f (diff)
parentb46fb8ff65bf345e51b11946783b450f6fa8f0a8 (diff)
merged from lp:~mvo/apt/mvo
-rw-r--r--methods/mirror.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 00757e61f..2cf5c9ce1 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -256,6 +256,13 @@ bool MirrorMethod::InitMirrors()
return _error->Error(_("No mirror file '%s' found "), MirrorFile.c_str());
}
+ if (access(MirrorFile.c_str(), R_OK) != 0)
+ {
+ // FIXME: fallback to a default mirror here instead
+ // and provide a config option to define that default
+ return _error->Error(_("Can not read mirror file '%s'"), MirrorFile.c_str());
+ }
+
// FIXME: make the mirror selection more clever, do not
// just use the first one!
// BUT: we can not make this random, the mirror has to be