Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o, Fabian Groffen <grobian@g.o>
Subject: Re: [gentoo-portage-dev] [PATCH] _collision_protect: report progress in work todo
Date: Sat, 26 Aug 2017 21:46:32
Message-Id: 1fca64e9-79a3-5500-ae28-3cc963038f3c@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] _collision_protect: report progress in work todo by Fabian Groffen
1 On 08/24/2017 06:28 AM, Fabian Groffen wrote:
2 > Currently Portage reports its progress in checking collisions forward
3 > every 1000th file like so:
4 >
5 > * checking 4149 files for package collisions
6 > 1000 files checked ...
7 > 2000 files checked ...
8 > 3000 files checked ...
9 > 4000 files checked ...
10 >>>> Merging sys-apps/portage-2.3.8 to /
11 >
12 > Change it to countdown style so it is easier to anticipate what the
13 > next action will be:
14 >
15 > * checking 4149 files for package collisions
16 > 3149 files remaining ...
17 > 2149 files remaining ...
18 > 1149 files remaining ...
19 > 149 files remaining ...
20 >>>> Merging sys-apps/portage-2.3.8 to /
21 > ---
22 > pym/portage/dbapi/vartree.py | 5 +++--
23 > 1 file changed, 3 insertions(+), 2 deletions(-)
24 >
25 > diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
26 > index 7c8f150bb..04a40b732 100644
27 > --- a/pym/portage/dbapi/vartree.py
28 > +++ b/pym/portage/dbapi/vartree.py
29 > @@ -3420,13 +3420,14 @@ class dblink(object):
30 > dirs_ro = set()
31 > symlink_collisions = []
32 > destroot = self.settings['ROOT']
33 > + totfiles = len(file_list) + len(symlink_list)
34 > showMessage(_(" %s checking %d files for package collisions\n") % \
35 > - (colorize("GOOD", "*"), len(file_list) + len(symlink_list)))
36 > + (colorize("GOOD", "*"), totfiles))
37 > for i, (f, f_type) in enumerate(chain(
38 > ((f, "reg") for f in file_list),
39 > ((f, "sym") for f in symlink_list))):
40 > if i % 1000 == 0 and i != 0:
41 > - showMessage(_("%d files checked ...\n") % i)
42 > + showMessage(_("%d files remaining ...\n") % (totfiles - i))
43 >
44 > dest_path = normalize_path(
45 > os.path.join(destroot, f.lstrip(os.path.sep)))
46 >
47
48 Looks good. Please merge.
49 --
50 Thanks,
51 Zac

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies