Browse Source

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
(cherry picked from commit c530a192d6)
(cherry picked from commit 721e65d430)
tags/debian/1.8.5
Julian Andres Klode 5 months ago
parent
commit
cfee71c6f2
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      apt-pkg/packagemanager.cc

+ 12
- 4
apt-pkg/packagemanager.cc View File

@@ -1029,10 +1029,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;


Loading…
Cancel
Save