diff options
author | Michael Vogt <mvo@debian.org> | 2011-03-11 13:57:52 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2011-03-11 13:57:52 +0100 |
commit | d19b539614c9ab44477e8716a5dd9983dd5a53b2 (patch) | |
tree | c6a7d9480118f802c02225589dab44bcef4de086 /methods | |
parent | a75b8cfeb6d7e2468b19534d5b5872c3885f0e1c (diff) | |
parent | d6cc7079e895e76ad9d086fcc6a40224dd41bb62 (diff) |
merged from lp:~mvo/apt/mvo
Diffstat (limited to 'methods')
-rw-r--r-- | methods/mirror.cc | 13 | ||||
-rw-r--r-- | methods/rsh.cc | 3 |
2 files changed, 11 insertions, 5 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc index e8873d97b..d092cc657 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -125,20 +125,25 @@ bool MirrorMethod::Clean(string Dir) bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) { - if(Debug) - clog << "MirrorMethod::DownloadMirrorFile(): " << endl; - // not that great to use pkgAcquire here, but we do not have // any other way right now string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); + if(Debug) + clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" + << " to " << MirrorFile << endl; + pkgAcquire Fetcher; new pkgAcqFile(&Fetcher, fetch, "", 0, "", "", "", MirrorFile); bool res = (Fetcher.Run() == pkgAcquire::Continue); if(res) DownloadedMirrorFile = true; Fetcher.Shutdown(); + + if(Debug) + clog << "MirrorMethod::DownloadMirrorFile() success: " << res << endl; + return res; } @@ -176,7 +181,7 @@ bool MirrorMethod::TryNextMirror() continue; vector<string>::const_iterator nextmirror = mirror + 1; - if (nextmirror != AllMirrors.end()) + if (nextmirror == AllMirrors.end()) break; Queue->Uri.replace(0, mirror->length(), *nextmirror); if (Debug) diff --git a/methods/rsh.cc b/methods/rsh.cc index 97b4ef151..21f0d0a22 100644 --- a/methods/rsh.cc +++ b/methods/rsh.cc @@ -110,6 +110,8 @@ bool RSHConn::Connect(string Host, string User) // Probably should do // dup2(open("/dev/null",O_RDONLY),STDERR_FILENO); + Args[i++] = Prog; + // Insert user-supplied command line options Configuration::Item const *Opts = RshOptions; if (Opts != 0) @@ -123,7 +125,6 @@ bool RSHConn::Connect(string Host, string User) } } - Args[i++] = Prog; if (User.empty() == false) { Args[i++] = "-l"; Args[i++] = User.c_str(); |