From: "Fabian Groffen" <grobian@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/
Date: Fri, 11 Jan 2019 10:14:55 +0000 (UTC) [thread overview]
Message-ID: <1547201662.cfa915d0d575379df4b9f17fd2db3594155861ca.grobian@gentoo> (raw)
commit: cfa915d0d575379df4b9f17fd2db3594155861ca
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Mon Jan 7 14:19:15 2019 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Jan 11 10:14:22 2019 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=cfa915d0
collision_protect: use dynamic report interval
The reporting of files remaining can look somewhat odd since the report
interval is hardcoded to be per 1000 objects. Adjust this interval to
be time based. This means that modern (fast) machines likely will never
see the countdown messages at all. On slow setups the message will be
informative that there is progress, albeit rather slowly. While at it,
report percentage done.
Output before this patch:
* checking 6158 files for package collisions
5158 files remaining ...
4158 files remaining ...
3158 files remaining ...
2158 files remaining ...
1158 files remaining ...
158 files remaining ...
Possible output after this patch on a slower machine:
* checking 6158 files for package collisions
48% done, 3145 files remaining ...
96% done, 192 files remaining ...
100% done
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
lib/portage/dbapi/vartree.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/lib/portage/dbapi/vartree.py b/lib/portage/dbapi/vartree.py
index 9febf0c71..63389f9a3 100644
--- a/lib/portage/dbapi/vartree.py
+++ b/lib/portage/dbapi/vartree.py
@@ -35,6 +35,7 @@ portage.proxy.lazyimport.lazyimport(globals(),
'portage.util.install_mask:install_mask_dir,InstallMask',
'portage.util.listdir:dircache,listdir',
'portage.util.movefile:movefile',
+ 'portage.util.monotonic:monotonic',
'portage.util.path:first_existing,iter_parents',
'portage.util.writeable_check:get_ro_checker',
'portage.util._xattr:xattr',
@@ -3453,13 +3454,21 @@ class dblink(object):
symlink_collisions = []
destroot = self.settings['ROOT']
totfiles = len(file_list) + len(symlink_list)
+ previous = monotonic()
+ progress_shown = False
+ report_interval = 1.7 # seconds
+ falign = len("%d" % totfiles)
showMessage(_(" %s checking %d files for package collisions\n") % \
(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 remaining ...\n") % (totfiles - i))
+ current = monotonic()
+ if current - previous > report_interval:
+ showMessage(_("%3d%% done, %*d files remaining ...\n") %
+ (i * 100 / totfiles, falign, totfiles - i))
+ previous = current
+ progress_shown = True
dest_path = normalize_path(
os.path.join(destroot, f.lstrip(os.path.sep)))
@@ -3548,6 +3557,8 @@ class dblink(object):
break
if stopmerge:
collisions.append(f)
+ if progress_shown:
+ showMessage(_("100% done\n"))
return collisions, dirs_ro, symlink_collisions, plib_collisions
def _lstat_inode_map(self, path_iter):
next reply other threads:[~2019-01-11 10:15 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 10:14 Fabian Groffen [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-01-24 21:29 [gentoo-commits] proj/portage:master commit in: lib/portage/dbapi/ Zac Medico
2025-01-09 23:35 Zac Medico
2024-06-01 19:20 Zac Medico
2024-05-27 18:13 Zac Medico
2024-03-02 22:55 Zac Medico
2024-02-25 8:25 Sam James
2024-01-16 7:52 Sam James
2024-01-16 5:26 Zac Medico
2024-01-16 5:16 Sam James
2024-01-16 5:16 Sam James
2024-01-03 5:57 Zac Medico
2023-12-10 1:28 Zac Medico
2023-10-24 18:37 Zac Medico
2023-10-23 14:28 Zac Medico
2023-10-22 21:30 Zac Medico
2023-10-22 20:58 Zac Medico
2023-10-22 15:53 Zac Medico
2023-10-20 0:34 Zac Medico
2023-10-15 22:02 Zac Medico
2023-10-08 19:48 Zac Medico
2023-10-05 5:45 Zac Medico
2023-10-04 4:29 Zac Medico
2023-09-26 21:09 Sam James
2023-09-23 22:49 Sam James
2023-09-23 22:38 Sam James
2023-09-23 22:31 Sam James
2023-09-20 18:02 Mike Gilbert
2023-09-15 4:28 Sam James
2023-07-29 3:57 Sam James
2023-05-23 0:26 Sam James
2023-05-23 0:26 Sam James
2023-05-23 0:26 Sam James
2022-12-21 1:30 Sam James
2022-12-21 1:28 Sam James
2022-11-08 23:07 Sam James
2022-09-25 19:12 Mike Gilbert
2022-09-09 10:16 Michał Górny
2022-08-18 19:00 Mike Gilbert
2022-04-20 20:24 Zac Medico
2022-04-13 15:34 Sam James
2022-04-13 15:34 Sam James
2021-11-26 21:09 Mike Gilbert
2021-09-21 5:51 Zac Medico
2021-09-21 5:51 Zac Medico
2021-09-21 5:51 Zac Medico
2021-06-05 18:08 Zac Medico
2021-03-07 11:42 Zac Medico
2021-02-23 21:31 Zac Medico
2021-01-18 9:20 Zac Medico
2021-01-17 13:31 Zac Medico
2021-01-17 8:49 Zac Medico
2021-01-17 8:49 Zac Medico
2020-09-08 2:52 Zac Medico
2020-08-09 0:15 Zac Medico
2020-08-04 3:16 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 23:28 Zac Medico
2020-08-03 21:42 Zac Medico
2020-08-03 21:42 Zac Medico
2020-08-03 19:30 Zac Medico
2020-07-22 20:14 Zac Medico
2020-07-22 19:52 Zac Medico
2020-07-22 17:46 Zac Medico
2020-06-07 3:26 Zac Medico
2020-02-20 9:55 Zac Medico
2020-02-03 3:04 Zac Medico
2019-08-24 3:15 Zac Medico
2019-06-20 19:43 Zac Medico
2019-05-11 21:16 Zac Medico
2019-01-20 6:55 Zac Medico
2018-09-24 7:30 Zac Medico
2018-09-24 0:46 Zac Medico
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1547201662.cfa915d0d575379df4b9f17fd2db3594155861ca.grobian@gentoo \
--to=grobian@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox