summaryrefslogtreecommitdiff
path: root/apt-pkg/deb/debmetaindex.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/deb/debmetaindex.cc')
-rw-r--r--apt-pkg/deb/debmetaindex.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index 1a89fcc88..f25906fba 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -274,11 +274,14 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
if (dup != IndexTargets.end())
{
std::string const dupEntry = dup->Option(IndexTarget::SOURCESENTRY);
- //TRANSLATOR: an identifier like Packages; Releasefile key indicating
- // a file like main/binary-amd64/Packages; filename and linenumber of
- // two sources.list entries
- _error->Warning(_("Target %s (%s) is configured multiple times in %s and %s"),
- T->c_str(), MetaKey.c_str(), dupEntry.c_str(), E->sourcesEntry.c_str());
+ if (T->find("legacy") == std::string::npos)
+ {
+ //TRANSLATOR: an identifier like Packages; Releasefile key indicating
+ // a file like main/binary-amd64/Packages; filename and linenumber of
+ // two sources.list entries
+ _error->Warning(_("Target %s (%s) is configured multiple times in %s and %s"),
+ T->c_str(), MetaKey.c_str(), dupEntry.c_str(), E->sourcesEntry.c_str());
+ }
if (tplMetaKey.find(BreakPoint) == std::string::npos)
break;
continue;
@@ -1098,8 +1101,11 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/
UseByHash = _config->Find("Acquire::By-Hash", UseByHash);
{
std::string const host = ::URI(URI).Host;
- UseByHash = _config->Find("APT::Acquire::" + host + "::By-Hash", UseByHash);
- UseByHash = _config->Find("Acquire::" + host + "::By-Hash", UseByHash);
+ if (host.empty() == false)
+ {
+ UseByHash = _config->Find("APT::Acquire::" + host + "::By-Hash", UseByHash);
+ UseByHash = _config->Find("Acquire::" + host + "::By-Hash", UseByHash);
+ }
std::map<std::string, std::string>::const_iterator const opt = Options.find("by-hash");
if (opt != Options.end())
UseByHash = opt->second;