From f701eb209fcc94e5b4f80656270d2fa21663b364 Mon Sep 17 00:00:00 2001 From: David Kalnischkies Date: Thu, 4 Feb 2021 00:48:22 +0100 Subject: Show 'Done' always for 'Building dependency tree' MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For years I subconsciously thought this is wrong but ignored it: $ LANG=C apt install -s Reading package lists... Done Building dependency tree Reading state information... Done Then I noticed: $ LANG=C apt install -s -o dir::state::extended_states=/dev/null Reading package lists... Done Building dependency tree... Done That can't be! Then it really should be: $ LANG=C apt install -s Reading package lists... Done Building dependency tree... Done Reading state information... Done This oddity seems to be in since the introduction of the auto bit in 2005 which makes this rather hard to solve in theory, but in practice no front end seems to call the readStateFile method directly, so we might actually be lucky. The alternative would be to call Done in the calling method and again at the end of readStateFile while dropping it from the current place, but as that is more shuffling around it could be more upsetting for other front ends. Not sure, but now that I have seen it, I want to have it fixed one way or another… aptitude at least seems not to explode. References: afb1e2e3bb580077c6c917e6ea98baad8f3c39b3 --- apt-pkg/depcache.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'apt-pkg') diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index f2b3dbcdc..3444c6a3c 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -290,8 +290,11 @@ bool pkgDepCache::readStateFile(OpProgress * const Prog) /*{{{*/ state_file.Open(state, FileFd::ReadOnly, FileFd::Extension); off_t const file_size = state_file.Size(); if(Prog != NULL) + { + Prog->Done(); Prog->OverallProgress(0, file_size, 1, _("Reading state information")); + } pkgTagFile tagfile(&state_file); pkgTagSection section; -- cgit v1.2.3-70-g09d2