diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-06-08 17:31:45 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-06-08 17:31:45 +0200 |
commit | b4450f1dd6bca537e60406b2383ab154a3e1485f (patch) | |
tree | 67ff0903b0dac59c1d307852e4768e63427e92ee /apt-pkg | |
parent | 007d8b488787f4c33ced5937f22f99f1b759088a (diff) |
don't explicitly configure the last round of packages
We end our operation by calling "dpkg --configure -a", so instead of
running a (big) configure run with all packages mentioned explicitly
before this, we simply skip them and let them be handled by this call
implicitly.
There isn't really an observeable gain to be had here from a speed
point, but it helps in avoiding an (uncommon) problem of having a too
long commandline passed to dpkg, which we would split up (probably
incorrectly).
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 4a77942f1..4591049a9 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1248,15 +1248,28 @@ bool pkgDPkgPM::Go(APT::Progress::PackageManager *progress) if (RunScriptsWithPkgs("DPkg::Pre-Install-Pkgs") == false) return false; + decltype(List)::const_iterator::difference_type const notconfidx = + _config->FindB("Dpkg::ExplicitLastConfigure", false) ? std::numeric_limits<decltype(notconfidx)>::max() : + std::distance(List.cbegin(), std::find_if_not(List.crbegin(), List.crend(), [](Item const &i) { return i.Op == Item::Configure; }).base()); + // support subpressing of triggers processing for special // cases like d-i that runs the triggers handling manually bool const TriggersPending = _config->FindB("DPkg::TriggersPending", false); - if (_config->FindB("DPkg::ConfigurePending", true) == true) + bool const ConfigurePending = _config->FindB("DPkg::ConfigurePending", true); + if (ConfigurePending) List.push_back(Item(Item::ConfigurePending, PkgIterator())); // for the progress BuildPackagesProgressMap(); + if (notconfidx != std::numeric_limits<decltype(notconfidx)>::max()) + { + if (ConfigurePending) + List.erase(std::next(List.cbegin(), notconfidx), std::prev(List.cend())); + else + List.erase(std::next(List.cbegin(), notconfidx), List.cend()); + } + d->stdin_is_dev_null = false; // create log |