* [gentoo-commits] portage r11608 - main/trunk/pym/_emerge
@ 2008-10-02 3:58 Zac Medico (zmedico)
0 siblings, 0 replies; only message in thread
From: Zac Medico (zmedico) @ 2008-10-02 3:58 UTC (permalink / raw
To: gentoo-commits
Author: zmedico
Date: 2008-10-02 03:58:49 +0000 (Thu, 02 Oct 2008)
New Revision: 11608
Modified:
main/trunk/pym/_emerge/__init__.py
Log:
Optimize display_preserved_libs() by using a single getFileOwnerMap() to look
up all the files.
Modified: main/trunk/pym/_emerge/__init__.py
===================================================================
--- main/trunk/pym/_emerge/__init__.py 2008-10-02 02:52:41 UTC (rev 11607)
+++ main/trunk/pym/_emerge/__init__.py 2008-10-02 03:58:49 UTC (rev 11608)
@@ -10907,13 +10907,27 @@
print colorize("WARN", "!!!") + " existing preserved libs:"
plibdata = vardbapi.plib_registry.getPreservedLibs()
linkmap = vardbapi.linkmap
+
+ consumer_map = {}
+ search_for_owners = set()
for cpv in plibdata:
+ for f in plibdata[cpv]:
+ if f in consumer_map:
+ continue
+ consumers = list(linkmap.findConsumers(f))
+ consumers.sort()
+ consumer_map[f] = consumers
+ search_for_owners.update(consumers[:MAX_DISPLAY+1])
+
+ all_owners = vardbapi._owners.getFileOwnerMap(search_for_owners)
+
+ for cpv in plibdata:
print colorize("WARN", ">>>") + " package: %s" % cpv
for f in plibdata[cpv]:
print colorize("WARN", " * ") + " - %s" % f
- consumers = list(linkmap.findConsumers(f))
- consumers.sort()
- owners = vardbapi._owners.getFileOwnerMap(consumers[:MAX_DISPLAY+2])
+ consumers = consumer_map[f]
+ owners = dict((c, all_owners[c])
+ for c in consumers[:MAX_DISPLAY+1])
for c in consumers[:MAX_DISPLAY]:
print colorize("WARN", " * ") + " used by %s (%s)" % (c, ", ".join([x.mycpv for x in owners[c]]))
if len(consumers) == MAX_DISPLAY + 1:
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-10-02 3:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-02 3:58 [gentoo-commits] portage r11608 - main/trunk/pym/_emerge Zac Medico (zmedico)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox