]> git.saurik.com Git - apt.git/commitdiff
* methods/mirror.cc:
authorMichael Vogt <michael.vogt@ubuntu.com>
Thu, 11 Aug 2011 14:33:42 +0000 (16:33 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Thu, 11 Aug 2011 14:33:42 +0000 (16:33 +0200)
  - include the architecture(s) in the query string as well so
    that the server can make better decisions

debian/changelog
methods/mirror.cc

index b2efeae1b9ad8b28e80ab098e6df1deb8345e814..519395af8c4f54cd57adc22ff709893b1328cb38 100644 (file)
@@ -2,8 +2,11 @@ apt (0.8.16~exp5ubuntu5) UNRELEASED; urgency=low
 
   * debian/control:
     - fix VCS location
 
   * debian/control:
     - fix VCS location
+  * methods/mirror.cc:
+    - include the architecture(s) in the query string as well so 
+      that the server can make better decisions
 
 
- -- Michael Vogt <michael.vogt@ubuntu.com>  Wed, 10 Aug 2011 06:48:11 +0200
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Thu, 11 Aug 2011 16:33:32 +0200
 
 apt (0.8.16~exp5ubuntu4) oneiric; urgency=low
 
 
 apt (0.8.16~exp5ubuntu4) oneiric; urgency=low
 
index 713dc211a1c8ecd103502ad4f419645749126c1c..7f28c04cbecf82079e0fa97945dcf2cc0a4f785c 100644 (file)
@@ -8,6 +8,7 @@
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
    ##################################################################### */
                                                                        /*}}}*/
 // Include Files                                                       /*{{{*/
+#include <apt-pkg/aptconfiguration.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/acquire-item.h>
 #include <apt-pkg/fileutl.h>
 #include <apt-pkg/acquire-method.h>
 #include <apt-pkg/acquire-item.h>
@@ -134,9 +135,24 @@ bool MirrorMethod::DownloadMirrorFile(string mirror_uri_str)
    string fetch = BaseUri;
    fetch.replace(0,strlen("mirror://"),"http://");
 
    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 != "")
    // append the dist as a query string
    if (Dist != "")
-      fetch += "?dist=" + Dist;
+      fetch += "&dist=" + Dist;
 
    if(Debug)
       clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'"
 
    if(Debug)
       clog << "MirrorMethod::DownloadMirrorFile(): '" << fetch << "'"