]> git.saurik.com Git - apt.git/commitdiff
cherry pick mirror fixes from lp:~mvo/apt/mvo
authorMichael Vogt <michael.vogt@ubuntu.com>
Tue, 7 Jun 2011 06:50:05 +0000 (08:50 +0200)
committerMichael Vogt <michael.vogt@ubuntu.com>
Tue, 7 Jun 2011 06:50:05 +0000 (08:50 +0200)
debian/changelog
methods/mirror.cc

index 8cc9b53e1c2c478b21b02d456ea36b7b6225b3bf..c5e5d9d1799102470bc9867bb0ead5eef203af4b 100644 (file)
@@ -1,12 +1,18 @@
 apt (0.8.14.1ubuntu6) UNRELEASEDoneiric; urgency=low
 
+  [ Brian Murray ]
   * apt-pkg/deb/dpkgpm.cc:
     - prevent reporting of package installation failures due to inaccessible
       local files (LP: #791102, #790040)
     - include /var/log/apt/history.log in apport-package reports so we know
       the context for the package management request
+    
+  [ Michael Vogt ]
+  * methods/mirror.cc:
+    - ignore lines starting with "#" in the mirror file
+    - ignore non http urls in the mirrors
 
- -- Brian Murray <brian@ubuntu.com>  Wed, 01 Jun 2011 12:32:31 -0700
+ -- Michael Vogt <michael.vogt@ubuntu.com>  Tue, 07 Jun 2011 08:49:43 +0200
 
 apt (0.8.14.1ubuntu5) oneiric; urgency=low
 
index 2cf5c9ce1110a9d7f9b259cf9913451b89126d94..8a7228def45c43d20ef7a081b00cc7f3aee0675c 100644 (file)
@@ -274,8 +274,18 @@ bool MirrorMethod::InitMirrors()
    while (!in.eof()) 
    {
       getline(in, s);
-      if (s.size() > 0)
-        AllMirrors.push_back(s);
+
+      // ignore lines that start with #
+      if (s.find("#") == 0)
+         continue;
+      // ignore empty lines
+      if (s.size() == 0)
+         continue;
+      // ignore non http lines
+      if (s.find("http://") != 0)
+         continue;
+
+      AllMirrors.push_back(s);
    }
    Mirror = AllMirrors[0];
    UsedMirror = Mirror;