diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2010-06-02 22:44:49 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2010-06-02 22:44:49 +0200 |
commit | 0ded3ad3438666f833773895ef6318f84d2f849d (patch) | |
tree | ab679eeaf7ac6a9df4b035fd8812a5eae19dc1b4 /methods | |
parent | 483dfdd8aced593e966d221073c056c2e332584f (diff) |
improve error message if mirror method fails
Diffstat (limited to 'methods')
-rw-r--r-- | methods/mirror.cc | 14 |
1 files changed, 8 insertions, 6 deletions
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<sstream> + #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); |