summaryrefslogtreecommitdiff
path: root/methods/mirror.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2011-09-13 17:52:22 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2011-09-13 17:52:22 +0200
commit74b220028595342028e3309002e4ec359af328f9 (patch)
tree0132b7fd4b4f5fa5e2dbce1f2e0fbeeff2c8e101 /methods/mirror.cc
parent650faab01603caac04494d54cf6b10a65c00ea13 (diff)
parentb11fe392b2245354591296df88c3be2e6218af12 (diff)
merge with debian/experimental
Diffstat (limited to 'methods/mirror.cc')
-rw-r--r--methods/mirror.cc24
1 files changed, 20 insertions, 4 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 768e6b3a3..61a7f12fd 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -10,6 +10,7 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/aptconfiguration.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/acquire-method.h>
#include <apt-pkg/acquire-item.h>
@@ -56,7 +57,7 @@ using namespace std;
*/
MirrorMethod::MirrorMethod()
- : HttpMethod(), DownloadedMirrorFile(false)
+ : HttpMethod(), DownloadedMirrorFile(false), Debug(false)
{
};
@@ -109,7 +110,7 @@ bool MirrorMethod::Clean(string Dir)
continue;
// see if we have that uri
- for(I=list.begin(); I != list.end(); I++)
+ for(I=list.begin(); I != list.end(); ++I)
{
string uri = (*I)->GetURI();
if(uri.find("mirror://") != 0)
@@ -136,9 +137,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<std::string> vec = APT::Configuration::getArchitectures();
+ for (std::vector<std::string>::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 << "'"
@@ -332,7 +348,7 @@ string MirrorMethod::GetMirrorFileName(string mirror_uri_str)
vector<metaIndex *>::const_iterator I;
pkgSourceList list;
list.ReadMainList();
- for(I=list.begin(); I != list.end(); I++)
+ for(I=list.begin(); I != list.end(); ++I)
{
string uristr = (*I)->GetURI();
if(Debug)