Currently Portage reports its progress in checking collisions forward
every 1000th file like so:

 * checking 4149 files for package collisions
1000 files checked ...
2000 files checked ...
3000 files checked ...
4000 files checked ...
>>> Merging sys-apps/portage-2.3.8 to /

Change it to countdown style so it is easier to anticipate what the
next action will be:

 * checking 4149 files for package collisions
3149 files remaining ...
2149 files remaining ...
1149 files remaining ...
149 files remaining ...
>>> Merging sys-apps/portage-2.3.8 to /
---
 pym/portage/dbapi/vartree.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
index 7c8f150bb..04a40b732 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -3420,13 +3420,14 @@ class dblink(object):
                        dirs_ro = set()
                        symlink_collisions = []
                        destroot = self.settings['ROOT']
+                       totfiles = len(file_list) + len(symlink_list)
                        showMessage(_(" %s checking %d files for package 
collisions\n") % \
-                               (colorize("GOOD", "*"), len(file_list) + 
len(symlink_list)))
+                               (colorize("GOOD", "*"), totfiles))
                        for i, (f, f_type) in enumerate(chain(
                                ((f, "reg") for f in file_list),
                                ((f, "sym") for f in symlink_list))):
                                if i % 1000 == 0 and i != 0:
-                                       showMessage(_("%d files checked ...\n") 
% i)
+                                       showMessage(_("%d files remaining 
...\n") % (totfiles - i))
 
                                dest_path = normalize_path(
                                        os.path.join(destroot, 
f.lstrip(os.path.sep)))
-- 
2.14.1


Reply via email to