- when downloading data, show the mirror being used
- randomize mirror list to ensure more even load
- merge fix from Matt Zimmerman, many thanks (LP: #741098)
+ - do not crash if the mirror file fails to download
-- Michael Vogt <michael.vogt@ubuntu.com> Thu, 10 Mar 2011 15:56:54 +0100
vector<string> content;
string line;
+ if (!FileExists(mirror_file))
+ return false;
+
// read
ifstream in(mirror_file.c_str());
while ( !in.eof() ) {
if(Itm->IndexFile && !DownloadedMirrorFile)
{
Clean(_config->FindDir("Dir::State::mirrors"));
- DownloadMirrorFile(Itm->Uri);
- RandomizeMirrorFile(MirrorFile);
+ if (DownloadMirrorFile(Itm->Uri))
+ RandomizeMirrorFile(MirrorFile);
}
if(AllMirrors.empty()) {