Gentoo Archives: gentoo-commits

From: "Marius Mauch (genone)" <genone@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r10179 - main/trunk/pym/portage/dbapi
Date: Sun, 04 May 2008 12:55:28
Message-Id: E1JsdkT-000274-QR@stork.gentoo.org
1 Author: genone
2 Date: 2008-05-04 12:55:24 +0000 (Sun, 04 May 2008)
3 New Revision: 10179
4
5 Modified:
6 main/trunk/pym/portage/dbapi/vartree.py
7 Log:
8 remove obsolete class
9
10 Modified: main/trunk/pym/portage/dbapi/vartree.py
11 ===================================================================
12 --- main/trunk/pym/portage/dbapi/vartree.py 2008-05-04 12:19:23 UTC (rev 10178)
13 +++ main/trunk/pym/portage/dbapi/vartree.py 2008-05-04 12:55:24 UTC (rev 10179)
14 @@ -222,48 +222,6 @@
15 rValue.add(x)
16 return rValue
17
18 -class LibraryPackageMap(object):
19 - """ This class provides a library->consumer mapping generated from VDB data """
20 - def __init__(self, filename, vardbapi):
21 - self._filename = filename
22 - self._dbapi = vardbapi
23 -
24 - def get(self):
25 - """ Read the global library->consumer map for the given vdb instance.
26 - @returns mapping of library objects (just basenames) to consumers (absolute paths)
27 - @rtype filename->list-of-paths
28 - """
29 - if not os.path.exists(self._filename):
30 - self.update()
31 - rValue = {}
32 - for l in open(self._filename, "r").read().split("\n"):
33 - mysplit = l.split()
34 - if len(mysplit) > 1:
35 - rValue[mysplit[0]] = mysplit[1].split(",")
36 - return rValue
37 -
38 - def update(self):
39 - """ Update the global library->consumer map for the given vdb instance. """
40 - obj_dict = {}
41 - aux_get = self._dbapi.aux_get
42 - for cpv in self._dbapi.cpv_all():
43 - needed_list = aux_get(cpv, ["NEEDED"])[0].splitlines()
44 - for l in needed_list:
45 - mysplit = l.split()
46 - if len(mysplit) < 2:
47 - continue
48 - libs = mysplit[1].split(",")
49 - for lib in libs:
50 - if not obj_dict.has_key(lib):
51 - obj_dict[lib] = [mysplit[0]]
52 - else:
53 - obj_dict[lib].append(mysplit[0])
54 - mapfile = open(self._filename, "w")
55 - for lib in sorted(obj_dict):
56 - obj_dict[lib].sort()
57 - mapfile.write(lib+" "+",".join(obj_dict[lib])+"\n")
58 - mapfile.close()
59 -
60 class vardbapi(dbapi):
61 def __init__(self, root, categories=None, settings=None, vartree=None):
62 """
63
64 --
65 gentoo-commits@l.g.o mailing list