Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11636 - main/trunk/pym/_emerge
Date: Sun, 05 Oct 2008 18:48:02
Message-Id: E1KmYe6-0004sm-U7@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-10-05 18:47:57 +0000 (Sun, 05 Oct 2008)
3 New Revision: 11636
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Bug #240022 - Avoid duplicate output for the same library (due to symlinks)
9 in display_preserved_libs() by using os.path.realpath() to group duplicate
10 references together. Thanks to Fabian Groffen <grobian@g.o> for the initial
11 patch.
12
13
14 Modified: main/trunk/pym/_emerge/__init__.py
15 ===================================================================
16 --- main/trunk/pym/_emerge/__init__.py 2008-10-05 18:00:09 UTC (rev 11635)
17 +++ main/trunk/pym/_emerge/__init__.py 2008-10-05 18:47:57 UTC (rev 11636)
18 @@ -10958,8 +10958,18 @@
19
20 for cpv in plibdata:
21 print colorize("WARN", ">>>") + " package: %s" % cpv
22 + samefile_map = {}
23 for f in plibdata[cpv]:
24 - print colorize("WARN", " * ") + " - %s" % f
25 + real_path = os.path.realpath(f)
26 + alt_paths = samefile_map.get(real_path)
27 + if alt_paths is None:
28 + alt_paths = set()
29 + samefile_map[real_path] = alt_paths
30 + alt_paths.add(f)
31 +
32 + for f, alt_paths in samefile_map.iteritems():
33 + for p in sorted(alt_paths):
34 + print colorize("WARN", " * ") + " - %s" % (p,)
35 consumers = consumer_map[f]
36 for c in consumers[:MAX_DISPLAY]:
37 print colorize("WARN", " * ") + " used by %s (%s)" % \