summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/deb/debmetaindex.cc16
-rw-r--r--apt-pkg/indexfile.cc1
-rw-r--r--apt-pkg/indexfile.h1
3 files changed, 13 insertions, 5 deletions
diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc
index a26b94d82..08d8ef05e 100644
--- a/apt-pkg/deb/debmetaindex.cc
+++ b/apt-pkg/deb/debmetaindex.cc
@@ -145,6 +145,7 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
std::string const tplLongDesc = "$(SITE) " + APT_T_CONFIG_STR(flatArchive ? "flatDescription" : "Description", "");
bool const IsOptional = APT_T_CONFIG_BOOL("Optional", true);
bool const KeepCompressed = APT_T_CONFIG_BOOL("KeepCompressed", GzipIndex);
+ bool const DefaultEnabled = APT_T_CONFIG_BOOL("DefaultEnabled", true);
bool const UsePDiffs = APT_T_CONFIG_BOOL("PDiffs", E->UsePDiffs);
std::string const CompressionTypes = APT_T_CONFIG_STR("CompressionTypes", DefCompressionTypes);
#undef APT_T_CONFIG_BOOL
@@ -185,10 +186,8 @@ static void GetIndexTargetsFor(char const * const Type, std::string const &URI,
Options.insert(std::make_pair("REPO_URI", URI));
Options.insert(std::make_pair("TARGET_OF", Type));
Options.insert(std::make_pair("CREATED_BY", *T));
- if (UsePDiffs)
- Options.insert(std::make_pair("PDIFFS", "yes"));
- else
- Options.insert(std::make_pair("PDIFFS", "no"));
+ Options.insert(std::make_pair("PDIFFS", UsePDiffs ? "yes" : "no"));
+ Options.insert(std::make_pair("DEFAULTENABLED", DefaultEnabled ? "yes" : "no"));
Options.insert(std::make_pair("COMPRESSIONTYPES", CompressionTypes));
IndexTarget Target(
@@ -736,7 +735,14 @@ class APT_HIDDEN debSLTypeDebian : public pkgSourceList::Type /*{{{*/
}
std::vector<std::string> const alltargets = _config->FindVector(std::string("Acquire::IndexTargets::") + Name, "", true);
- std::vector<std::string> mytargets = parsePlusMinusOptions("target", Options, alltargets);
+ std::vector<std::string> deftargets;
+ deftargets.reserve(alltargets.size());
+ std::copy_if(alltargets.begin(), alltargets.end(), std::back_inserter(deftargets), [&](std::string const &t) {
+ std::string c = "Acquire::IndexTargets::";
+ c.append(Name).append("::").append(t).append("::DefaultEnabled");
+ return _config->FindB(c, true);
+ });
+ std::vector<std::string> mytargets = parsePlusMinusOptions("target", Options, deftargets);
for (auto const &target : alltargets)
{
std::map<std::string, std::string>::const_iterator const opt = Options.find(target);
diff --git a/apt-pkg/indexfile.cc b/apt-pkg/indexfile.cc
index 775ddf712..1ed798410 100644
--- a/apt-pkg/indexfile.cc
+++ b/apt-pkg/indexfile.cc
@@ -145,6 +145,7 @@ std::string IndexTarget::Option(OptionKeys const EnumKey) const /*{{{*/
APT_CASE(TARGET_OF);
APT_CASE(CREATED_BY);
APT_CASE(PDIFFS);
+ APT_CASE(DEFAULTENABLED);
APT_CASE(COMPRESSIONTYPES);
#undef APT_CASE
case FILENAME: return _config->FindDir("Dir::State::lists") + URItoFileName(URI);
diff --git a/apt-pkg/indexfile.h b/apt-pkg/indexfile.h
index 8f7e9dc05..f267247c1 100644
--- a/apt-pkg/indexfile.h
+++ b/apt-pkg/indexfile.h
@@ -87,6 +87,7 @@ class IndexTarget /*{{{*/
EXISTING_FILENAME,
PDIFFS,
COMPRESSIONTYPES,
+ DEFAULTENABLED,
};
std::string Option(OptionKeys const Key) const;
bool OptionBool(OptionKeys const Key) const;