Gentoo Archives: gentoo-commits

From: "Fabian Groffen (grobian)" <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11811 - main/branches/prefix/pym/portage/dbapi
Date: Wed, 05 Nov 2008 18:29:51
Message-Id: E1Kxn8W-0004VF-HY@stork.gentoo.org
1 Author: grobian
2 Date: 2008-11-05 18:29:48 +0000 (Wed, 05 Nov 2008)
3 New Revision: 11811
4
5 Modified:
6 main/branches/prefix/pym/portage/dbapi/vartree.py
7 Log:
8 Make some changes to make the LinkageMapMachO more compatible (codewise) to LinkageMap. It isn't necessary, since no patch lookups are done, as we have absolute paths as keys.
9
10 Modified: main/branches/prefix/pym/portage/dbapi/vartree.py
11 ===================================================================
12 --- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-11-05 18:08:52 UTC (rev 11810)
13 +++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-11-05 18:29:48 UTC (rev 11811)
14 @@ -2,7 +2,7 @@
15 # Distributed under the terms of the GNU General Public License v2
16 # $Id$
17
18 -__all__ = ["PreservedLibsRegistry", "LinkageMap",
19 +__all__ = ["PreservedLibsRegistry", "LinkageMap", "LinkageMapMachO",
20 "vardbapi", "vartree", "dblink"] + \
21 ["write_contents", "tar_contents"]
22
23 @@ -639,7 +639,21 @@
24 self._libs = {}
25 self._obj_properties = {}
26 self._obj_key_cache = {}
27 + self._path_key_cache = {}
28
29 + def _clear_cache(self):
30 + self._libs.clear()
31 + self._obj_properties.clear()
32 + self._obj_key_cache.clear()
33 + self._path_key_cache.clear()
34 +
35 + def _path_key(self, path):
36 + key = self._path_key_cache.get(path)
37 + if key is None:
38 + key = self._ObjectKey(path, self._root)
39 + self._path_key_cache[path] = key
40 + return key
41 +
42 class _ObjectKey(object):
43
44 """Helper class used as _obj_properties keys for objects."""
45 @@ -710,9 +724,11 @@
46
47 def rebuild(self, exclude_pkgs=None, include_file=None):
48 root = self._root
49 - libs = {}
50 - obj_key_cache = {}
51 - obj_properties = {}
52 + self._clear_cache()
53 + libs = self._libs
54 + obj_key_cache = self._obj_key_cache
55 + obj_properties = self._obj_properties
56 +
57 lines = []
58 for cpv in self._dbapi.cpv_all():
59 if exclude_pkgs is not None and cpv in exclude_pkgs:
60 @@ -772,10 +788,6 @@
61 obj_properties.setdefault(obj_key, \
62 (arch, needed, install_name, set()))[3].add(obj)
63
64 - self._libs = libs
65 - self._obj_properties = obj_properties
66 - self._obj_key_cache = obj_key_cache
67 -
68 def listBrokenBinaries(self, debug=False):
69 """
70 Find binaries and their needed install_names, which have no providers.