]> git.saurik.com Git - apt.git/commitdiff
append the dist (e.g. sid, wheezy) as a query string when
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 7 Jun 2011 13:54:23 +0000 (15:54 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 7 Jun 2011 13:54:23 +0000 (15:54 +0200)
asking for a suitable mirror

debian/changelog
methods/mirror.cc
methods/mirror.h

index c5e5d9d1799102470bc9867bb0ead5eef203af4b..27211b37fd5477a45b47e678d7a87ceac4d8a1ef 100644 (file)
@@ -11,8 +11,10 @@ apt (0.8.14.1ubuntu6) UNRELEASEDoneiric; 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 <michael.vogt@ubuntu.com>  Tue, 07 Jun 2011 08:49:43 +0200
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 07 Jun 2011 15:54:14 +0200
 
 apt (0.8.14.1ubuntu5) oneiric; urgency=low
 
index 8a7228def45c43d20ef7a081b00cc7f3aee0675c..713dc211a1c8ecd103502ad4f419645749126c1c 100644 (file)
@@ -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
index bd807e1227c0f84b4bf92bf24753337541f2d88b..97d18144a49bfbc64440941c58fc6f3b6ea54344 100644 (file)
@@ -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;