summaryrefslogtreecommitdiff
path: root/cmdline
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2021-03-18 17:37:49 +0100
committerDavid Kalnischkies <david@kalnischkies.de>2021-04-26 13:00:24 +0200
commitd6f3458badf2cfea3ca7de7632ae31daff5742be (patch)
tree7acc19c1e590fe8c2c81ef6609fa1a5a863d90da /cmdline
parent9a54e70c1040379fb06827bacb461c61e341e694 (diff)
Call MarkAndSweep only manually in apt-get for autoremove
An interactive tool like aptitude needs these flags current far more often than we do as a user can see them in apt only in one very well defined place – the autoremove display block – so we don't need to run it up to four times while a normal "apt install" is processed as that is just busywork. The effect on runtime is minimal, as a single run doesn't take too long anyhow, but it cuts down tremendously on debug output at the expense of requiring some manual handholding. This is opt-in so that aptitude doesn't need to change nor do we need to change our own tools like "apt list" where it is working correctly as intended. A special flag and co is needed as we want to prevent the ActionGroup inside pkgDepCache::Init to be inhibited already so we need to insert ourselves while the DepCache is still in the process of being built. This is also the reason why the debug output in some tests changed to all unmarked, but that is fine as the marking could have been already obsoleted by the actions taken, just inhibited by a proper action group.
Diffstat (limited to 'cmdline')
-rw-r--r--cmdline/apt-internal-solver.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index d22eb75b4..23af6dab7 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -146,6 +146,7 @@ int main(int argc,const char *argv[]) /*{{{*/
EDSP::WriteProgress(5, "Read scenario…", output);
pkgCacheFile CacheFile;
+ CacheFile.InhibitActionGroups(true);
if (CacheFile.Open(NULL, false) == false)
DIE("Failed to open CacheFile!");
@@ -202,6 +203,7 @@ int main(int argc,const char *argv[]) /*{{{*/
EDSP::WriteProgress(95, "Write solution…", output);
+ CacheFile->MarkAndSweep();
if (WriteSolution(CacheFile, output) == false)
DIE("Failed to output the solution!");