From a21aca106ce93e8a2841d4a2c7a8432f9dfc7b6d Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Mon, 6 Jun 2016 15:04:42 +0200 Subject: 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. --- apt-pkg/edsp.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'apt-pkg/edsp.cc') 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::listSet("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()); -- cgit v1.2.3