if (RunScriptsWithPkgs("DPkg::Pre-Install-Pkgs") == false)
return false;
+ auto const noopDPkgInvocation = _config->FindB("Debug::pkgDPkgPM",false);
+ // store auto-bits as they are supposed to be after dpkg is run
+ if (noopDPkgInvocation == false)
+ Cache.writeStateFile(NULL);
+
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());
if (notconfidx != std::numeric_limits<decltype(notconfidx)>::max())
{
if (ConfigurePending)
- List.erase(std::next(List.cbegin(), notconfidx), std::prev(List.cend()));
+ List.erase(std::next(List.begin(), notconfidx), std::prev(List.end()));
else
- List.erase(std::next(List.cbegin(), notconfidx), List.cend());
+ List.erase(std::next(List.begin(), notconfidx), List.end());
}
d->stdin_is_dev_null = false;
J = I;
- if (_config->FindB("Debug::pkgDPkgPM",false) == true)
+ if (noopDPkgInvocation == true)
{
for (std::vector<const char *>::const_iterator a = Args.begin();
a != Args.end(); ++a)
p != Packages.end(); ++p)
free(*p);
Packages.clear();
+ close(fd[0]);
+ close(fd[1]);
continue;
}
Args.push_back(NULL);
if (pkgPackageManager::SigINTStop)
_error->Warning(_("Operation was interrupted before it could finish"));
- if (_config->FindB("Debug::pkgDPkgPM",false) == false)
+ if (noopDPkgInvocation == false)
{
std::string const oldpkgcache = _config->FindFile("Dir::cache::pkgcache");
if (oldpkgcache.empty() == false && RealFileExists(oldpkgcache) == true &&
}
}
- Cache.writeStateFile(NULL);
+ // disappearing packages can forward their auto-bit
+ if (disappearedPkgs.empty() == false)
+ Cache.writeStateFile(NULL);
d->progress->Stop();