From ae54c5356b2d0d9776528d1eeb773c57f5b82ef4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 11 Aug 2011 16:30:17 +0200 Subject: [PATCH] * methods/mirror.cc: - include the architecture(s) in the query string as well so that the server can make better decisions --- debian/changelog | 3 +++ methods/mirror.cc | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/debian/changelog b/debian/changelog index db80c14e..3d9bdb31 100644 --- a/debian/changelog +++ b/debian/changelog @@ -12,6 +12,9 @@ apt (0.8.16~exp5) experimental; urgency=low like the translations index * apt-pkg/acquire.cc: - fix potential divide-by-zero + * methods/mirror.cc: + - include the architecture(s) in the query string as well so + that the server can make better decisions -- Michael Vogt Fri, 05 Aug 2011 10:57:08 +0200 diff --git a/methods/mirror.cc b/methods/mirror.cc index 713dc211..7f28c04c 100644 --- a/methods/mirror.cc +++ b/methods/mirror.cc @@ -8,6 +8,7 @@ ##################################################################### */ /*}}}*/ // Include Files /*{{{*/ +#include #include #include #include @@ -134,9 +135,24 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str) string fetch = BaseUri; fetch.replace(0,strlen("mirror://"),"http://"); +#if 0 // no need for this, the getArchitectures() will also include the main + // arch + // append main architecture + fetch += "?arch=" + _config->Find("Apt::Architecture"); +#endif + + // append all architectures + std::vector vec = APT::Configuration::getArchitectures(); + for (std::vector::const_iterator I = vec.begin(); + I != vec.end(); I++) + if (I == vec.begin()) + fetch += "?arch" + (*I); + else + fetch += "&arch=" + (*I); + // append the dist as a query string if (Dist != "") - fetch += "?dist=" + Dist; + fetch += "&dist=" + Dist; if(Debug) clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'" -- 2.20.1