X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/066b53e95ba224f81d078e7d8df3002275f8a092..a577a938d4b957b5462a830b21d509fa754b33d5:/methods/mirror.cc diff --git a/methods/mirror.cc b/methods/mirror.cc index ff91130b8..9fe64fd70 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -35,13 +35,14 @@ using namespace std; * - always picks the first mirror from the list * - call out to problem reporting script * - supports "deb mirror://host/path/to/mirror-list/// dist component" - * - use pkgAcqMethod::FailReason() to have a string representation + * - uses pkgAcqMethod::FailReason() to have a string representation * of the failure that is also send to LP * * TODO: * - deal with runing as non-root because we can't write to the lists dir then -> use the cached mirror file * - better method to download than having a pkgAcquire interface here + * and better error handling there! * - support more than http * - testing :) */ @@ -143,7 +144,8 @@ bool MirrorMethod::GetMirrorFile(string mirror_uri_str) in both cases! So we need to apply some domain knowledge here :( and check for /dists/ or /Release.gpg as suffixes */ - std::cerr << "GetMirrorFile: " << mirror_uri_str << std::endl; + if(Debug) + std::cerr << "GetMirrorFile: " << mirror_uri_str << std::endl; // read sources.list and find match vector::const_iterator I; @@ -152,13 +154,15 @@ bool MirrorMethod::GetMirrorFile(string mirror_uri_str) for(I=list.begin(); I != list.end(); I++) { string uristr = (*I)->GetURI(); - std::cerr << "Checking: " << uristr << std::endl; + if(Debug) + std::cerr << "Checking: " << uristr << std::endl; if(uristr.substr(0,strlen("mirror://")) != string("mirror://")) continue; // find matching uri in sources.list if(mirror_uri_str.substr(0,uristr.size()) == uristr) { - std::cerr << "found BaseURI: " << uristr << std::endl; + if(Debug) + std::cerr << "found BaseURI: " << uristr << std::endl; BaseUri = uristr.substr(0,uristr.size()-1); } }