* - 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 :)
*/
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<metaIndex *>::const_iterator I;
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);
}
}