Gentoo Archives: gentoo-portage-dev

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

Attachments

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