summaryrefslogtreecommitdiff
path: root/methods/mirror.cc
diff options
context:
space:
mode:
authorChristopher Baines <cbaines8@gmail.com>2011-07-05 13:28:22 +0100
committerChristopher Baines <cbaines8@gmail.com>2011-07-05 13:28:22 +0100
commiteef7133842d6fe5847daa0ab4846b5e8be892d61 (patch)
tree7e79b1374c1db5f9b4c02b8d05393e61e3e6cf7b /methods/mirror.cc
parent2a5ca0006bad04956141f3180dd8e6b6d7fdf731 (diff)
parent8d0303273495fc478ae62570ecf1675942cfbc41 (diff)
[ David Kalnischkies ]
* doc/makefile: - create doxygen directory to avoid depending on magic (Closes: #628799) * cmdline/apt-key: - explicitly state that net-update is not supported if no url is set - require to be root for add, rm, update and net-update - clarify update vs. net-update in different distros (Closes: #632043) * debian/apt.symbols: - forgot 'mips' in the list for all architecture dependent symbols - comment out gcc-4.5 specific symbols as gcc-4.6 is now default - the symbol for PrintStatus() is architecture dependent * apt-pkg/policy.cc: - do not segfault in pinning if a package with this name doesn't exist. Thanks to Ferdinand Thommes for the report! - Defaults is a vector of Pin not of PkgPin - ensure that only the first specific stanza for a package is used - save all stanzas which had no effect in Unmatched - allow package:architecure in Package: - remove invalid pkgcache.bin and rebuild it if possible - log reinstall commands in history.log * apt-pkg/init.cc: - don't set deprecated APT::Acquire::Translation, thanks Jörg Sommer! * cmdline/apt-config.cc: - show Acquire::Languages and APT::Architectures settings in 'dump' (Closes: 626739) * apt-pkg/orderlist.cc: - ensure that an old version of a package with a provides can never satisfy a dependency of a newer version of this package [ Michael Vogt ] * 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 * apt-pkg/deb/deblistparser.cc: - include all known languages when building the apt cache (LP: #794907) * apt-pkg/deb/debindexfile.cc: - remove some no longer valid checks for "TranslationsAvailable()" [ Kenneth Solbø Andersen ] * apt-pkg/deb/dpkgpm.cc: - set permissions of term.log to root.adm and 644 (LP: #404724) [ Chris Leick ] * various typo and syntax corrections in doc/*.xml [Chris Baines] * Began to fix DepAdd for imediate configuration of all packages
Diffstat (limited to 'methods/mirror.cc')
-rw-r--r--methods/mirror.cc19
1 files changed, 17 insertions, 2 deletions
diff --git a/methods/mirror.cc b/methods/mirror.cc
index 2cf5c9ce1..713dc211a 100644
--- a/methods/mirror.cc
+++ b/methods/mirror.cc
@@ -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;
@@ -274,8 +278,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;
@@ -329,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