diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-06-06 15:04:42 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-06-27 11:57:12 +0200 |
commit | a21aca106ce93e8a2841d4a2c7a8432f9dfc7b6d (patch) | |
tree | 2a535fc3d6c5aabba64709dc3d3be82cf90d66a1 /apt-pkg/edsp.cc | |
parent | 14bed2c0108a99d68f453ff61273d5ae59a5c3f0 (diff) |
eipp: implement Immediate-Configuration flag
APT has 3 modes: no immediate configuration, all packages are configured
immediately and its default mode of configuring essentials and
pseudo-essentials immediately only. While this seems like a job of
different planers at first, it might be handy to have it as an option,
too, in case a planer (like apts internal one) supports different modes
where the introduction of individual planers would be counter intuitive.
Diffstat (limited to 'apt-pkg/edsp.cc')
-rw-r--r-- | apt-pkg/edsp.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc index 21f7f3607..e79bb804c 100644 --- a/apt-pkg/edsp.cc +++ b/apt-pkg/edsp.cc @@ -1112,7 +1112,6 @@ bool EIPP::WriteRequest(pkgDepCache &Cache, FileFd &output, /*{{{*/ unsigned int const flags, OpProgress * const Progress) { - (void)(flags); if (Progress != NULL) Progress->SubProgress(Cache.Head().PackageCount, _("Send request to planer")); unsigned long p = 0; @@ -1152,6 +1151,10 @@ bool EIPP::WriteRequest(pkgDepCache &Cache, FileFd &output, /*{{{*/ if (reinst.empty() == false) WriteOkay(Okay, output, "ReInstall:", reinst, "\n"); WriteOkay(Okay, output, "Planer: ", _config->Find("APT::Planer", "internal"), "\n"); + if ((flags & Request::IMMEDIATE_CONFIGURATION_ALL) != 0) + WriteOkay(Okay, output, "Immediate-Configuration: yes\n"); + else if ((flags & Request::NO_IMMEDIATE_CONFIGURATION) != 0) + WriteOkay(Okay, output, "Immediate-Configuration: no\n"); return WriteOkay(Okay, output, "\n"); } /*}}}*/ @@ -1379,6 +1382,13 @@ bool EIPP::ReadRequest(int const input, std::list<std::pair<std::string,PKG_ACTI _config->Set("APT::Architectures", SubstVar(line, " ", ",")); else if (LineStartsWithAndStrip(line, "Planer:")) ; // purely informational line + else if (LineStartsWithAndStrip(line, "Immediate-Configuration:")) + { + if (localStringToBool(line, true)) + flags |= Request::IMMEDIATE_CONFIGURATION_ALL; + else + flags |= Request::NO_IMMEDIATE_CONFIGURATION; + } else _error->Warning("Unknown line in EIPP Request stanza: %s", line.c_str()); |