summaryrefslogtreecommitdiff
path: root/methods/mirror.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-06-07 08:50:05 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-06-07 08:50:05 +0200
commit72dcdb508bc52838047f72413f050bf0439435fb (patch)
tree284f47c0e74870cd5fc8bfd1f1d508522e0a8e02 /methods/mirror.cc
parent9bafec989612e0bb751e4ba1e3a81d21233ccb9b (diff)
cherry pick mirror fixes from lp:~mvo/apt/mvo
Diffstat (limited to 'methods/mirror.cc')
-rw-r--r--methods/mirror.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 2cf5c9ce1..8a7228def 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -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;