[PATCH] _collision_protect: report progress in work todo

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] _collision_protect: report progress in work todo

Fabian Groffen-2
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 | Threaded
Open this post in threaded view
|

Re: [PATCH] _collision_protect: report progress in work todo

Zac Medico-2
On 08/24/2017 06:28 AM, Fabian Groffen wrote:

> 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)))
>
Looks good. Please merge.
--
Thanks,
Zac


signature.asc (231 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] _collision_protect: report progress in work todo

Fabian Groffen-2
On 26-08-2017 14:46:30 -0700, Zac Medico wrote:

> On 08/24/2017 06:28 AM, Fabian Groffen wrote:
> > 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)))
> >
>
> Looks good. Please merge.
Pushed, thanks

Fabian

--
Fabian Groffen
Gentoo on a different level

signature.asc (201 bytes) Download Attachment