Gentoo Archives: gentoo-portage-dev

From: Brian Harring <ferringb@×××××.com>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] Re: r5993 - main/trunk/pym/portage/dbapi
Date: Sun, 18 Feb 2007 19:21:20
Message-Id: 20070218191953.GB12544@seldon
In Reply to: [gentoo-portage-dev] Re: r5993 - main/trunk/pym/portage/dbapi by Brian Harring
1 Bleh, pardon; left out a bit accidentally-
2
3 On Sun, Feb 18, 2007 at 11:03:33AM -0800, Brian Harring wrote:
4 > On Sun, Feb 18, 2007 at 06:27:59PM +0000, Marius Mauch wrote:
5 > > - for lib in preserve_libs.copy():
6 > > - old_contents_without_libs = [x for x in old_contents if os.path.basename(x) not in preserve_libs]
7 > > - if len(set(libmap[lib]).intersection(old_contents_without_libs)) == len(libmap[lib]):
8 > > - preserve_libs.remove(lib)
9 > > + def has_external_consumers(lib, contents, otherlibs):
10 > > + consumers = set(libmap[lib])
11 >
12 > # this should be done *once*.
13 > # further, if libmap where k->set, you'd avoid repeated
14 > # creation of sets all over the damn place.
15 >
16 > > + contents_without_libs = [x for x in contents if not os.path.basename(x) in otherlibs]
17 >
18 > # os.path.basename invocations aren't horribly expensive, but the
19 continual calls to it make the code more verbose then needed (Thus
20 harder to follow), and slower. Consider a mapping instead, see the
21 first review for old_based...
22
23 ~harring