diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/edsp.cc | 12 | ||||
-rw-r--r-- | apt-pkg/edsp.h | 11 | ||||
-rw-r--r-- | apt-pkg/packagemanager.cc | 8 |
3 files changed, 28 insertions, 3 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()); diff --git a/apt-pkg/edsp.h b/apt-pkg/edsp.h index 271cbb6a8..e1ffdf598 100644 --- a/apt-pkg/edsp.h +++ b/apt-pkg/edsp.h @@ -239,8 +239,17 @@ namespace EDSP /*{{{*/ class pkgPackageManager; namespace EIPP /*{{{*/ { + namespace Request + { + enum Flags + { + IMMEDIATE_CONFIGURATION_ALL = (1 << 0), /*!< try to keep the least amount of packages unconfigured as possible at all times */ + NO_IMMEDIATE_CONFIGURATION = (1 << 1), /*!< do not perform immediate configuration at all */ + }; + } + APT_HIDDEN bool WriteRequest(pkgDepCache &Cache, FileFd &output, - unsigned int const version, OpProgress * const Progress); + unsigned int const flags, OpProgress * const Progress); APT_HIDDEN bool WriteScenario(pkgDepCache &Cache, FileFd &output, OpProgress * const Progress); diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc index 173fa8085..d5afceb6d 100644 --- a/apt-pkg/packagemanager.cc +++ b/apt-pkg/packagemanager.cc @@ -1040,7 +1040,13 @@ pkgPackageManager::OrderResult pkgPackageManager::OrderInstall() std::string const planer = _config->Find("APT::Planer", "internal"); if (planer != "internal") { - if (EIPP::OrderInstall(planer.c_str(), this, 0, nullptr)) + unsigned int flags = 0; + if (_config->FindB("APT::Immediate-Configure", true) == false) + flags |= EIPP::Request::NO_IMMEDIATE_CONFIGURATION; + else if (_config->FindB("APT::Immediate-Configure-All", false)) + flags |= EIPP::Request::IMMEDIATE_CONFIGURATION_ALL; + + if (EIPP::OrderInstall(planer.c_str(), this, flags, nullptr)) return Completed; else return Failed; |