diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-07 08:50:05 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2011-06-07 08:50:05 +0200 |
commit | 72dcdb508bc52838047f72413f050bf0439435fb (patch) | |
tree | 284f47c0e74870cd5fc8bfd1f1d508522e0a8e02 | |
parent | 9bafec989612e0bb751e4ba1e3a81d21233ccb9b (diff) |
cherry pick mirror fixes from lp:~mvo/apt/mvo
-rw-r--r-- | debian/changelog | 8 | ||||
-rw-r--r-- | methods/mirror.cc | 14 |
2 files changed, 19 insertions, 3 deletions
diff --git a/debian/changelog b/debian/changelog index 8cc9b53e1..c5e5d9d17 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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; |