summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2021-01-08 12:36:31 +0100
committerJulian Andres Klode <julian.klode@canonical.com>2021-01-08 12:38:23 +0100
commitc530a192d6a57e091d400cb42f9ce0d5a327ff01 (patch)
tree73088a0a4a40ad10072d1ee91779fa2049ecb34d
parent7ad5d4a7cc9f43fe84c51cd23d5440a3c8c3774d (diff)
Make immediate configuration optional
The benefits of immediate configuration are that Essential packages will be configured immediately, so if they are wrongly not working without being configured they won't fail later packages. However, we've reached the point where dependencies on the essential set are too complex for immediate configuration to always work, causing installations to error out at the end, despite having succeeded, because we did not correctly return the error here and did not check for pending errors before running dpkg. Given that we check and configure any packages at the end that have not been configured yet, or fail if we can't configure them; making immediate configuration optional is the best way forward - it orders as it does now, but then does not spuriously fail after having successfully installed everything. Closes: #973305, #188161, #211075, #649588 LP: #1871268
-rw-r--r--apt-pkg/packagemanager.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index a1b3f4537..0c6998def 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -1006,10 +1006,18 @@ bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate, int c
return false;
if (Immediate == true) {
- // Perform immediate configuration of the package.
- if (SmartConfigure(Pkg, Depth + 1) == false)
- _error->Warning(_("Could not perform immediate configuration on '%s'. "
- "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),Pkg.FullName().c_str(),2);
+ // Perform immediate configuration of the package.
+ _error->PushToStack();
+ bool configured = SmartConfigure(Pkg, Depth + 1);
+ _error->RevertToStack();
+
+ if (not configured && Debug) {
+ clog << OutputInDepth(Depth);
+ ioprintf(clog, _("Could not perform immediate configuration on '%s'. "
+ "Please see man 5 apt.conf under APT::Immediate-Configure for details. (%d)"),
+ Pkg.FullName().c_str(), 2);
+ clog << endl;
+ }
}
return true;