1 |
Author: grobian |
2 |
Date: 2008-05-04 13:33:49 +0000 (Sun, 04 May 2008) |
3 |
New Revision: 10181 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/pym/portage/dbapi/vartree.py |
7 |
Log: |
8 |
Merged from trunk 10178:10180 |
9 |
|
10 |
| 10179 | remove obsolete class | |
11 |
| genone | | |
12 |
|
13 |
| 10180 | remove NEEDED from list of metadata variables (and associated | |
14 |
| genone | special handling) as it's no longer used | |
15 |
|
16 |
|
17 |
Modified: main/branches/prefix/pym/portage/dbapi/vartree.py |
18 |
=================================================================== |
19 |
--- main/branches/prefix/pym/portage/dbapi/vartree.py 2008-05-04 13:00:53 UTC (rev 10180) |
20 |
+++ main/branches/prefix/pym/portage/dbapi/vartree.py 2008-05-04 13:33:49 UTC (rev 10181) |
21 |
@@ -306,55 +306,6 @@ |
22 |
rValue.add(x) |
23 |
return rValue |
24 |
|
25 |
-class LibraryPackageMap(object): |
26 |
- """ This class provides a library->consumer mapping generated from VDB data """ |
27 |
- def __init__(self, filename, vardbapi): |
28 |
- self._filename = filename |
29 |
- self._dbapi = vardbapi |
30 |
- |
31 |
- def get(self): |
32 |
- """ Read the global library->consumer map for the given vdb instance. |
33 |
- @returns mapping of library objects (just basenames) to consumers (absolute paths) |
34 |
- @rtype filename->list-of-paths |
35 |
- """ |
36 |
- if not os.path.exists(self._filename): |
37 |
- self.update() |
38 |
- rValue = {} |
39 |
- for l in open(self._filename, "r").read().split("\n"): |
40 |
- mysplit = l.split() |
41 |
- if len(mysplit) > 1: |
42 |
- rValue[mysplit[0]] = mysplit[1].split(",") |
43 |
- return rValue |
44 |
- |
45 |
- def update(self): |
46 |
- """ Update the global library->consumer map for the given vdb instance. """ |
47 |
- obj_dict = {} |
48 |
- aux_get = self._dbapi.aux_get |
49 |
- for cpv in self._dbapi.cpv_all(): |
50 |
- needed_list = aux_get(cpv, ["NEEDED"])[0].splitlines() |
51 |
- for l in needed_list: |
52 |
- mysplit = l.split() |
53 |
- if len(mysplit) < 2: |
54 |
- continue |
55 |
- libs = mysplit[1].split(",") |
56 |
- for lib in libs: |
57 |
- # In Prefix we can't do anything about host provided |
58 |
- # libs, it also makes little sense to try and |
59 |
- # preserve them, so filter them out here. |
60 |
- if '/' in lib: |
61 |
- if not lib.startswith(EPREFIX): |
62 |
- continue |
63 |
- |
64 |
- if not obj_dict.has_key(lib): |
65 |
- obj_dict[lib] = [mysplit[0]] |
66 |
- else: |
67 |
- obj_dict[lib].append(mysplit[0]) |
68 |
- mapfile = open(self._filename, "w") |
69 |
- for lib in sorted(obj_dict): |
70 |
- obj_dict[lib].sort() |
71 |
- mapfile.write(lib+" "+",".join(obj_dict[lib])+"\n") |
72 |
- mapfile.close() |
73 |
- |
74 |
class vardbapi(dbapi): |
75 |
def __init__(self, root, categories=None, settings=None, vartree=None): |
76 |
""" |
77 |
@@ -384,7 +335,7 @@ |
78 |
self._aux_cache_keys = set( |
79 |
["CHOST", "COUNTER", "DEPEND", "DESCRIPTION", |
80 |
"EAPI", "HOMEPAGE", "IUSE", "KEYWORDS", |
81 |
- "LICENSE", "PDEPEND", "PROVIDE", "RDEPEND", "NEEDED", |
82 |
+ "LICENSE", "PDEPEND", "PROVIDE", "RDEPEND", |
83 |
"repository", "RESTRICT" , "SLOT", "USE"]) |
84 |
self._aux_cache = None |
85 |
self._aux_cache_version = "1" |
86 |
@@ -719,12 +670,6 @@ |
87 |
cache_valid = cache_mtime == mydir_mtime |
88 |
if cache_valid: |
89 |
cache_incomplete = self._aux_cache_keys.difference(metadata) |
90 |
- needed = metadata.get("NEEDED") |
91 |
- if needed is None or needed and "\n" not in needed: |
92 |
- # Cached value has whitespace filtered, so it has to be pulled |
93 |
- # again. This is temporary migration code which can be removed |
94 |
- # later, since it only affects users who are running trunk. |
95 |
- cache_incomplete.add("NEEDED") |
96 |
if cache_incomplete: |
97 |
# Allow self._aux_cache_keys to change without a cache version |
98 |
# bump and efficiently recycle partial cache whenever possible. |
99 |
@@ -766,8 +711,7 @@ |
100 |
myd = myf.read() |
101 |
finally: |
102 |
myf.close() |
103 |
- if x != "NEEDED": |
104 |
- myd = " ".join(myd.split()) |
105 |
+ myd = " ".join(myd.split()) |
106 |
except IOError: |
107 |
myd = "" |
108 |
if x == "EAPI" and not myd: |
109 |
|
110 |
-- |
111 |
gentoo-commits@l.g.o mailing list |