diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-07 13:21:47 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-07 13:21:47 +0200 |
commit | 6885f3def825a5a0be6bb1715c800fada22f9b73 (patch) | |
tree | 7d05446e7665e1f8d77c6e0359302b6318345c83 | |
parent | 95f395cc774d522eda1b80b310bd75767aa11bd4 (diff) | |
download | apt-6885f3def825a5a0be6bb1715c800fada22f9b73.tar.gz |
append the dist (e.g. sid, wheezy) as a query string when
asking for a suitable mirror
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | methods/mirror.cc | 5 | ||||
-rw-r--r-- | methods/mirror.h | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog index 9fbcf0ad6..dc653a090 100644 --- a/debian/changelog +++ b/debian/changelog @@ -78,6 +78,8 @@ apt (0.8.15) UNRELEASED; urgency=low * methods/mirror.cc: - ignore lines starting with "#" in the mirror file - ignore non http urls in the mirrors + - append the dist (e.g. sid, wheezy) as a query string when + asking for a suitable mirror -- Michael Vogt <mvo@debian.org> Mon, 16 May 2011 14:57:52 +0200 diff --git a/methods/mirror.cc b/methods/mirror.cc index 8a7228def..713dc211a 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -134,6 +134,10 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); + // append the dist as a query string + if (Dist != "") + fetch += "?dist=" + Dist; + if(Debug) clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" << " to " << MirrorFile << endl; @@ -339,6 +343,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str) if(Debug) std::cerr << "found BaseURI: " << uristr << std::endl; BaseUri = uristr.substr(0,uristr.size()-1); + Dist = (*I)->GetDist(); } } // get new file diff --git a/methods/mirror.h b/methods/mirror.h index bd807e122..97d18144a 100644 --- a/methods/mirror.h +++ b/methods/mirror.h @@ -29,6 +29,7 @@ class MirrorMethod : public HttpMethod vector<string> AllMirrors; // all available mirrors string MirrorFile; // the file that contains the list of mirrors bool DownloadedMirrorFile; // already downloaded this session + string Dist; // the target distrubtion (e.g. sid, oneiric) bool Debug; |