Target != IndexTargets.end();
++Target)
{
- bool trypdiff = _config->FindB("Acquire::PDiffs", true);
+ bool trypdiff = Target->OptionBool(IndexTarget::PDIFFS);
if (verify == true)
{
if (TransactionManager->MetaIndexParser->Exists(Target->MetaKey) == false)
std::vector<std::string> Targets;
std::vector<std::string> Architectures;
std::vector<std::string> Languages;
+ bool UsePDiffs;
};
std::vector<debSectionEntry> DebEntries;
std::string const tplLongDesc = "$(SITE) " + APT_T_CONFIG(flatArchive ? "flatDescription" : "Description");
bool const IsOptional = _config->FindB(std::string("Acquire::IndexTargets::") + Type + "::" + *T + "::Optional", true);
bool const KeepCompressed = _config->FindB(std::string("Acquire::IndexTargets::") + Type + "::" + *T + "::KeepCompressed", GzipIndex);
+ bool const UsePDiffs = _config->FindB(std::string("Acquire::IndexTargets::") + Type + "::" + *T + "::PDiffs", E->UsePDiffs);
#undef APT_T_CONFIG
if (tplMetaKey.empty())
continue;
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"));
std::string MetaKey = tplMetaKey;
std::string ShortDesc = tplShortDesc;
void debReleaseIndex::AddComponent(bool const isSrc, std::string const &Name,/*{{{*/
std::vector<std::string> const &Targets,
std::vector<std::string> const &Architectures,
- std::vector<std::string> Languages)
+ std::vector<std::string> Languages,
+ bool const usePDiffs)
{
if (Languages.empty() == true)
Languages.push_back("none");
debReleaseIndexPrivate::debSectionEntry const entry = {
- Name, Targets, Architectures, Languages
+ Name, Targets, Architectures, Languages, usePDiffs
};
if (isSrc)
d->DebSrcEntries.push_back(entry);
else if (optValue == false && tarItr != mytargets.end())
mytargets.erase(std::remove(mytargets.begin(), mytargets.end(), target), mytargets.end());
}
+ bool UsePDiffs = _config->FindB("Acquire::PDiffs", true);
+ {
+ std::map<std::string, std::string>::const_iterator const opt = Options.find("pdiffs");
+ if (opt != Options.end())
+ UsePDiffs = StringToBool(opt->second);
+ }
Deb->AddComponent(
IsSrc,
Section,
mytargets,
parsePlusMinusOptions("arch", Options, APT::Configuration::getArchitectures()),
- parsePlusMinusOptions("lang", Options, APT::Configuration::getLanguages(true))
+ parsePlusMinusOptions("lang", Options, APT::Configuration::getLanguages(true)),
+ UsePDiffs
);
if (Deb->SetTrusted(GetTriStateOption(Options, "trusted")) == false ||
void AddComponent(bool const isSrc, std::string const &Name,
std::vector<std::string> const &Targets,
std::vector<std::string> const &Architectures,
- std::vector<std::string> Languages);
+ std::vector<std::string> Languages,
+ bool const usePDiffs);
};
#endif
APT_CASE(REPO_URI);
APT_CASE(TARGET_OF);
APT_CASE(CREATED_BY);
+ APT_CASE(PDIFFS);
#undef APT_CASE
case FILENAME: return _config->FindDir("Dir::State::lists") + URItoFileName(URI);
case EXISTING_FILENAME:
return M->second;
}
/*}}}*/
+bool IndexTarget::OptionBool(OptionKeys const EnumKey) const /*{{{*/
+{
+ return StringToBool(Option(EnumKey));
+}
+ /*}}}*/
std::string IndexTarget::Format(std::string format) const /*{{{*/
{
for (std::map<std::string, std::string>::const_iterator O = Options.begin(); O != Options.end(); ++O)
TARGET_OF,
FILENAME,
EXISTING_FILENAME,
+ PDIFFS,
};
std::string Option(OptionKeys const Key) const;
+ bool OptionBool(OptionKeys const Key) const;
std::string Format(std::string format) const;
};
/*}}}*/
mapping.insert(std::make_pair("Valid-Until-Min", std::make_pair("valid-until-min", false)));
mapping.insert(std::make_pair("Valid-Until-Max", std::make_pair("valid-until-max", false)));
mapping.insert(std::make_pair("Signed-By", std::make_pair("signed-by", false)));
+ mapping.insert(std::make_pair("PDiffs", std::make_pair("pdiffs", false)));
for (std::map<char const * const, std::pair<char const * const, bool> >::const_iterator m = mapping.begin(); m != mapping.end(); ++m)
if (Tags.Exists(m->first))
for (std::map<std::string,std::string>::const_iterator O = AddOptions.begin(); O != AddOptions.end(); ++O)
stanza << format_key(O->first) << ": " << O->second << "\n";
for (std::map<std::string,std::string>::const_iterator O = T->Options.begin(); O != T->Options.end(); ++O)
- stanza << format_key(O->first) << ": " << O->second << "\n";
+ {
+ if (O->first == "PDIFFS")
+ stanza << "PDiffs: " << O->second << "\n";
+ else
+ stanza << format_key(O->first) << ": " << O->second << "\n";
+ }
stanza << "\n";
if (Filtered)
use pdiff patching if provided by the repository and enabled by the
user. You only have to ensure that the Release file contains the
information about the compressed files/pdiffs to make this happen.
-NO properties have to be set to enable this.
+*NO* properties have to be set to enable this!
+
+
+Additional properties exist, but these should *NOT* be set by frontends
+requesting files. They exist for internal and end-user usage only:
+* PDiffs: controls if apt will try to use pdiffs for this target.
+ Defaults to the value of Acquire::PDiffs which is true by default.
+ Can be overridden per-source by the sources.list option of the same
+ name. See the documentation for both of these for details.
# More examples
<varlistentry><term><option>PDiffs</option></term>
<listitem><para>Try to download deltas called <literal>PDiffs</literal> for
- indexes (like <filename>Packages</filename> files) instead of downloading
- whole ones. True by default.</para>
+ indexes (like <filename>Packages</filename> files) instead of
+ downloading whole ones. True by default. Preferably, this can be set
+ for specific &sources-list; entries or index files by using the
+ <option>PDiffs</option> option there.</para>
<para>Two sub-options to limit the use of PDiffs are also available:
<literal>FileLimit</literal> can be used to specify a maximum number of
PDiff files should be downloaded to update a file. <literal>SizeLimit</literal>
using the identifier as field name instead of using this
multivalue option.
</para></listitem>
+
+ <listitem><para><option>PDiffs</option> (<option>pdiffs</option>)
+ is a yes/no value which controls if APT should try to use PDiffs
+ to update old indexes instead of downloading the new indexes
+ entirely. The value of this option is ignored if the repository
+ doesn't announce the availability of PDiffs. Defaults to the
+ value of the option with the same name for a specific index file
+ defined in the <option>Acquire::IndexTargets</option> scope,
+ which itself default to the value of configuration option
+ <option>Acquire::PDiffs</option> which defaults to
+ <literal>yes</literal>.
+ </para></listitem>
+
+
</itemizedlist>
Further more, there are options which if set effect