summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-06-07 08:48:09 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-06-07 08:48:09 +0200
commit95f395cc774d522eda1b80b310bd75767aa11bd4 (patch)
treed82eba4b865d75577ec85b5c9c8882f1c6a9cba7
parenta0c3110e038a5186d9b108ccea06fb00619436f0 (diff)
* methods/mirror.cc:
- ignore lines starting with "#" in the mirror file - ignore non http urls in the mirrors
-rw-r--r--debian/changelog5
-rw-r--r--methods/mirror.cc14
2 files changed, 17 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index d02091f54..9fbcf0ad6 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -73,6 +73,11 @@ apt (0.8.15) UNRELEASED; urgency=low
* apt-pkg/packagemanager.cc:
- ensure for Multi-Arch:same packages that they are unpacked in
lock step even in immediate configuration (Closes: #618288)
+
+ [ Michael Vogt ]
+ * methods/mirror.cc:
+ - ignore lines starting with "#" in the mirror file
+ - ignore non http urls in the mirrors
-- Michael Vogt <mvo@debian.org> Mon, 16 May 2011 14:57:52 +0200
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;