From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] post_emerge: Display all preserved libs with --verbose
Date: Tue, 31 Aug 2021 14:06:22 +0200 [thread overview]
Message-ID: <20210831120622.219791-1-mgorny@gentoo.org> (raw)
---
lib/_emerge/post_emerge.py | 2 +-
lib/portage/util/_dyn_libs/display_preserved_libs.py | 11 +++++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/lib/_emerge/post_emerge.py b/lib/_emerge/post_emerge.py
index 0c4df0d32..c540308d3 100644
--- a/lib/_emerge/post_emerge.py
+++ b/lib/_emerge/post_emerge.py
@@ -140,7 +140,7 @@ def post_emerge(myaction, myopts, myfiles,
else:
print()
print(colorize("WARN", "!!!") + " existing preserved libs:")
- display_preserved_libs(vardbapi)
+ display_preserved_libs(vardbapi, verbose="--verbose" in myopts)
print("Use " + colorize("GOOD", "emerge @preserved-rebuild") +
" to rebuild packages using these libraries")
diff --git a/lib/portage/util/_dyn_libs/display_preserved_libs.py b/lib/portage/util/_dyn_libs/display_preserved_libs.py
index 8deafc25e..5818501bb 100644
--- a/lib/portage/util/_dyn_libs/display_preserved_libs.py
+++ b/lib/portage/util/_dyn_libs/display_preserved_libs.py
@@ -6,7 +6,7 @@ import portage
from portage.output import colorize
-def display_preserved_libs(vardb):
+def display_preserved_libs(vardb, verbose=False):
MAX_DISPLAY = 3
@@ -36,7 +36,8 @@ def display_preserved_libs(vardb):
consumers.append(c)
consumers.sort()
consumer_map[f] = consumers
- search_for_owners.update(consumers[:MAX_DISPLAY+1])
+ max_search = None if verbose else MAX_DISPLAY + 1
+ search_for_owners.update(consumers[:max_search])
owners = {}
for f in search_for_owners:
@@ -75,7 +76,9 @@ def display_preserved_libs(vardb):
# they don't need to be rebuilt (see bug #461908).
consumers = consumers_non_preserved
- if len(consumers) == MAX_DISPLAY + 1:
+ if verbose:
+ max_display = None
+ elif len(consumers) == MAX_DISPLAY + 1:
# Display 1 extra consumer, instead of displaying
# "used by 1 other files".
max_display = MAX_DISPLAY + 1
@@ -91,6 +94,6 @@ def display_preserved_libs(vardb):
owners_desc = ", ".join(x.mycpv for x in owners.get(c, []))
print(colorize("WARN", " * ") + " used by %s (%s)" % \
(c, owners_desc))
- if len(consumers) > max_display:
+ if not verbose and len(consumers) > max_display:
print(colorize("WARN", " * ") + " used by %d other files" %
(len(consumers) - max_display))
--
2.33.0
reply other threads:[~2021-08-31 12:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20210831120622.219791-1-mgorny@gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-portage-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