summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2008-10-05 18:47:57 +0000
committerZac Medico <zmedico@gentoo.org>2008-10-05 18:47:57 +0000
commit5d0860aa4e55c73e55bd487bb562202cd183e467 (patch)
treed0c1d147d0cb9ead1cda71ec47051ad0dab9bf93 /pym
parenta2c9cbd00a5551aa696574d23dd8ab8c85e5248c (diff)
downloadportage-5d0860aa4e55c73e55bd487bb562202cd183e467.tar.gz
portage-5d0860aa4e55c73e55bd487bb562202cd183e467.tar.bz2
portage-5d0860aa4e55c73e55bd487bb562202cd183e467.zip
Bug #240022 - Avoid duplicate output for the same library (due to symlinks)
in display_preserved_libs() by using os.path.realpath() to group duplicate references together. Thanks to Fabian Groffen <grobian@g.o> for the initial patch. svn path=/main/trunk/; revision=11636
Diffstat (limited to 'pym')
-rw-r--r--pym/_emerge/__init__.py12
1 files changed, 11 insertions, 1 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py
index e103951fe..1add5ed5d 100644
--- a/pym/_emerge/__init__.py
+++ b/pym/_emerge/__init__.py
@@ -10958,8 +10958,18 @@ def display_preserved_libs(vardbapi):
for cpv in plibdata:
print colorize("WARN", ">>>") + " package: %s" % cpv
+ samefile_map = {}
for f in plibdata[cpv]:
- print colorize("WARN", " * ") + " - %s" % f
+ real_path = os.path.realpath(f)
+ alt_paths = samefile_map.get(real_path)
+ if alt_paths is None:
+ alt_paths = set()
+ samefile_map[real_path] = alt_paths
+ alt_paths.add(f)
+
+ for f, alt_paths in samefile_map.iteritems():
+ for p in sorted(alt_paths):
+ print colorize("WARN", " * ") + " - %s" % (p,)
consumers = consumer_map[f]
for c in consumers[:MAX_DISPLAY]:
print colorize("WARN", " * ") + " used by %s (%s)" % \