diff options
author | Zac Medico <zmedico@gentoo.org> | 2008-10-05 16:57:47 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2008-10-05 16:57:47 +0000 |
commit | fe6195eb8feec3c018b870f9b38441bcffe20664 (patch) | |
tree | 5fcc43f60658cc38c238bdec414d39e5b12dc500 | |
parent | 1640da21752b8a2eccf860cdbc5898128e0fe4b4 (diff) | |
download | portage-fe6195eb8feec3c018b870f9b38441bcffe20664.tar.gz portage-fe6195eb8feec3c018b870f9b38441bcffe20664.tar.bz2 portage-fe6195eb8feec3c018b870f9b38441bcffe20664.zip |
Avoid raising a KeyError from display_preserved_libs() in cases when no
owners are found for a particular library consumer.
svn path=/main/trunk/; revision=11633
-rw-r--r-- | pym/_emerge/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 9f72c3789..e103951fe 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -10962,11 +10962,12 @@ def display_preserved_libs(vardbapi): print colorize("WARN", " * ") + " - %s" % f consumers = consumer_map[f] for c in consumers[:MAX_DISPLAY]: - print colorize("WARN", " * ") + " used by %s (%s)" % (c, ", ".join([x.mycpv for x in owners[c]])) + print colorize("WARN", " * ") + " used by %s (%s)" % \ + (c, ", ".join(x.mycpv for x in owners.get(c, []))) if len(consumers) == MAX_DISPLAY + 1: print colorize("WARN", " * ") + " used by %s (%s)" % \ - (consumers[MAX_DISPLAY], ", ".join( - x.mycpv for x in owners[consumers[MAX_DISPLAY]])) + (consumers[MAX_DISPLAY], ", ".join(x.mycpv \ + for x in owners.get(consumers[MAX_DISPLAY], []))) elif len(consumers) > MAX_DISPLAY: print colorize("WARN", " * ") + " used by %d other files" % (len(consumers) - MAX_DISPLAY) print "Use " + colorize("GOOD", "emerge @preserved-rebuild") + " to rebuild packages using these libraries" |