HCoop
/
ntk
/
apt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0004842
)
methods/mirror.cc: raise error if the mirror file can not be read
author
Michael Vogt
<michael.vogt@ubuntu.com>
Thu, 24 Mar 2011 17:01:25 +0000
(18:01 +0100)
committer
Michael Vogt
<michael.vogt@ubuntu.com>
Thu, 24 Mar 2011 17:01:25 +0000
(18:01 +0100)
methods/mirror.cc
patch
|
blob
|
blame
|
history
diff --git
a/methods/mirror.cc
b/methods/mirror.cc
index
00757e6
..
2cf5c9c
100644
(file)
--- 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