From 0ded3ad3438666f833773895ef6318f84d2f849d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 2 Jun 2010 22:44:49 +0200 Subject: improve error message if mirror method fails --- methods/mirror.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'methods') diff --git a/methods/mirror.cc b/methods/mirror.cc index b8bd6db73..b9fa55d87 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -25,6 +25,8 @@ using namespace std; +#include + #include "mirror.h" #include "http.h" #include "apti18n.h" @@ -164,16 +166,12 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) bool MirrorMethod::SelectNextMirror() { - if (AllMirrors.size() < 1) - return false; - - Mirror = AllMirrors[0]; - AllMirrors.erase(AllMirrors.begin()); if(Debug) cerr << "using mirror: " << Mirror << endl; + Mirror = AllMirrors[0]; UsedMirror = Mirror; - return true; + return false; } bool MirrorMethod::InitMirrors() @@ -324,6 +322,10 @@ void MirrorMethod::Fail(string Err,bool Transient) } // all mirrors failed, so bail out + string s; + strprintf(s, _("[Mirror: %s]"), Mirror.c_str()); + SetIP(s); + if(Queue->Uri.find("http://") != string::npos) Queue->Uri.replace(0,Mirror.size(), BaseUri); pkgAcqMethod::Fail(Err, Transient); -- cgit v1.2.3