From 1b81f6bd13bb31e59da3f53cfdc7caab43abf887 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 6 Mar 2020 13:10:04 +0100 Subject: Show absolute time while waiting for lock instead of %, rework message Showing a percentage for a timeout is pretty non-standard. Rework the progress class so it can show an absolute progress (currently hardcoded to use seconds as a unit). If there is a timeout (aka if it's not the maximum long long unsigned -1llu), then show the timeout, otherwise just count up seconds, e.g. Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 33842 (apt)... 1/120s or Waiting for cache lock: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 33842 (apt)... 1s Also improve the error message to use "Waiting for cache lock: %s" instead of "... (%s)", as having multiple sentences inside parenthesis is super weird, as is having two closing parens. We pass the information via _config, as that's reasonably easy and avoids ABI hackage. It also provides an interesting debugging tool for other kinds of progress. --- doc/examples/configure-index | 2 ++ 1 file changed, 2 insertions(+) (limited to 'doc/examples') diff --git a/doc/examples/configure-index b/doc/examples/configure-index index 4e0bd57ae..bf9efc109 100644 --- a/doc/examples/configure-index +++ b/doc/examples/configure-index @@ -826,3 +826,5 @@ dir::filelistdir ""; dir::dpkg::tupletable ""; dir::dpkg::triplettable ""; dir::dpkg::cputable ""; + +APT::Internal::OpProgress::Absolute ""; -- cgit v1.2.3