1 |
Author: grobian |
2 |
Date: 2009-01-30 21:23:15 +0000 (Fri, 30 Jan 2009) |
3 |
New Revision: 12562 |
4 |
|
5 |
Modified: |
6 |
main/branches/prefix/pym/_emerge/__init__.py |
7 |
main/branches/prefix/pym/portage/__init__.py |
8 |
Log: |
9 |
Merged from trunk -r12543:12552 |
10 |
|
11 |
| 12544 | Fix interaction between ignorelist and ignorecvs parameters | |
12 |
| zmedico | inside cacheddir(). Thanks to Christian Ruppert for | |
13 |
| | reporting. | |
14 |
|
15 |
| 12545 | Make listdir(ignorecvs=True) ignore .git directories. Thanks | |
16 |
| zmedico | to Christian Ruppert for the suggestion. | |
17 |
|
18 |
| 12546 | Make depgraph._add_dep() ignore fewer dependencies when not | |
19 |
| zmedico | in --deep mode, by making it so that it will always account | |
20 |
| | for dependencies on packages that are already installed. | |
21 |
|
22 |
| 12547 | Inside depgraph.loadResumeCommand(), when appropriate, | |
23 |
| zmedico | complete the graph before analyzing any unsatisfied deps | |
24 |
| | that may exist. | |
25 |
|
26 |
| 12548 | Inside depgraph.loadResumeCommand(), always enable deep | |
27 |
| zmedico | traversal of dependencies. This is necessary for correct | |
28 |
| | --keep-going or --resume operation in case a package from a | |
29 |
| | group of circularly dependent packages fails. | |
30 |
|
31 |
| 12549 | Inside depgraph._add_dep(), drop unnecessary build-time deps | |
32 |
| zmedico | if there is no package available to satisfy it. | |
33 |
|
34 |
| 12550 | Fix typo in previous commit. | |
35 |
| zmedico | | |
36 |
|
37 |
| 12551 | Add an ignore_priority parameter to digraph.parent_nodes(). | |
38 |
| zmedico | | |
39 |
|
40 |
| 12552 | Inside depgraph._dep_expand(), filter use dbapi.cp_list() to | |
41 |
| zmedico | filter out any results from dbapi.cp_all() that happen to | |
42 |
| | not contain any ebuilds. Thanks to Jeremy Olexa | |
43 |
| | <darkside@g.o> for reporting. | |
44 |
|
45 |
|
46 |
Modified: main/branches/prefix/pym/_emerge/__init__.py |
47 |
=================================================================== |
48 |
--- main/branches/prefix/pym/_emerge/__init__.py 2009-01-30 21:20:54 UTC (rev 12561) |
49 |
+++ main/branches/prefix/pym/_emerge/__init__.py 2009-01-30 21:23:15 UTC (rev 12562) |
50 |
@@ -4847,6 +4847,10 @@ |
51 |
dep_pkg, existing_node = self._select_package(dep.root, dep.atom, |
52 |
onlydeps=dep.onlydeps) |
53 |
if not dep_pkg: |
54 |
+ if dep.priority.satisfied: |
55 |
+ # This could be an unecessary build-time dep |
56 |
+ # pulled in by --with-bdeps=y. |
57 |
+ return 1 |
58 |
if allow_unsatisfied: |
59 |
self._unsatisfied_deps.append(dep) |
60 |
return 1 |
61 |
@@ -4859,6 +4863,7 @@ |
62 |
# discarded dependencies reduce the amount of information |
63 |
# available for optimization of merge order. |
64 |
if dep.priority.satisfied and \ |
65 |
+ not dep_pkg.installed and \ |
66 |
not (existing_node or empty or deep or update): |
67 |
myarg = None |
68 |
if dep.root == self.target_root: |
69 |
@@ -5201,9 +5206,9 @@ |
70 |
atom_without_category, "null")) |
71 |
cat, atom_pn = portage.catsplit(null_cp) |
72 |
|
73 |
+ dbs = self._filtered_trees[root_config.root]["dbs"] |
74 |
cp_set = set() |
75 |
- for db, pkg_type, built, installed, db_keys in \ |
76 |
- self._filtered_trees[root_config.root]["dbs"]: |
77 |
+ for db, pkg_type, built, installed, db_keys in dbs: |
78 |
cp_set.update(db.cp_all()) |
79 |
for cp in list(cp_set): |
80 |
cat, pn = portage.catsplit(cp) |
81 |
@@ -5211,6 +5216,13 @@ |
82 |
cp_set.discard(cp) |
83 |
deps = [] |
84 |
for cp in cp_set: |
85 |
+ have_pkg = False |
86 |
+ for db, pkg_type, built, installed, db_keys in dbs: |
87 |
+ if db.cp_list(cp): |
88 |
+ have_pkg = True |
89 |
+ break |
90 |
+ if not have_pkg: |
91 |
+ continue |
92 |
cat, pn = portage.catsplit(cp) |
93 |
deps.append(insert_category_into_atom( |
94 |
atom_without_category, cat)) |
95 |
@@ -8518,6 +8530,19 @@ |
96 |
else: |
97 |
self._select_package = self._select_pkg_from_graph |
98 |
self.myparams.add("selective") |
99 |
+ # Always traverse deep dependencies in order to account for |
100 |
+ # potentially unsatisfied dependencies of installed packages. |
101 |
+ # This is necessary for correct --keep-going or --resume operation |
102 |
+ # in case a package from a group of circularly dependent packages |
103 |
+ # fails. In this case, a package which has recently been installed |
104 |
+ # may have an unsatisfied circular dependency (pulled in by |
105 |
+ # PDEPEND, for example). So, even though a package is already |
106 |
+ # installed, it may not have all of it's dependencies satisfied, so |
107 |
+ # it may not be usable. If such a package is in the subgraph of |
108 |
+ # deep depenedencies of a scheduled build, that build needs to |
109 |
+ # be cancelled. In order for this type of situation to be |
110 |
+ # recognized, deep traversal of dependencies is required. |
111 |
+ self.myparams.add("deep") |
112 |
|
113 |
favorites = resume_data.get("favorites") |
114 |
args_set = self._sets["args"] |
115 |
|
116 |
Modified: main/branches/prefix/pym/portage/__init__.py |
117 |
=================================================================== |
118 |
--- main/branches/prefix/pym/portage/__init__.py 2009-01-30 21:20:54 UTC (rev 12561) |
119 |
+++ main/branches/prefix/pym/portage/__init__.py 2009-01-30 21:23:15 UTC (rev 12562) |
120 |
@@ -253,16 +253,21 @@ |
121 |
ret_list = [] |
122 |
ret_ftype = [] |
123 |
for x in range(0, len(list)): |
124 |
- if(ignorecvs and (len(list[x]) > 2) and (list[x][:2]!=".#")): |
125 |
+ if list[x] in ignorelist: |
126 |
+ pass |
127 |
+ elif ignorecvs: |
128 |
+ if list[x][:2] != ".#": |
129 |
+ ret_list.append(list[x]) |
130 |
+ ret_ftype.append(ftype[x]) |
131 |
+ else: |
132 |
ret_list.append(list[x]) |
133 |
ret_ftype.append(ftype[x]) |
134 |
- elif (list[x] not in ignorelist): |
135 |
- ret_list.append(list[x]) |
136 |
- ret_ftype.append(ftype[x]) |
137 |
|
138 |
writemsg("cacheddirStats: H:%d/M:%d/S:%d\n" % (cacheHit, cacheMiss, cacheStale),10) |
139 |
return ret_list, ret_ftype |
140 |
|
141 |
+_ignorecvs_dirs = ('CVS', 'SCCS', '.svn', '.git') |
142 |
+ |
143 |
def listdir(mypath, recursive=False, filesonly=False, ignorecvs=False, ignorelist=[], followSymlinks=True, |
144 |
EmptyOnError=False, dirsonly=False): |
145 |
""" |
146 |
@@ -274,7 +279,7 @@ |
147 |
@type recursive: Boolean |
148 |
@param filesonly; Only return files, not more directories |
149 |
@type filesonly: Boolean |
150 |
- @param ignorecvs: Ignore CVS directories ('CVS','.svn','SCCS') |
151 |
+ @param ignorecvs: Ignore CVS directories ('CVS','SCCS','.svn','.git') |
152 |
@type ignorecvs: Boolean |
153 |
@param ignorelist: List of filenames/directories to exclude |
154 |
@type ignorelist: List |
155 |
@@ -301,7 +306,8 @@ |
156 |
if recursive: |
157 |
x=0 |
158 |
while x<len(ftype): |
159 |
- if ftype[x]==1 and not (ignorecvs and os.path.basename(list[x]) in ('CVS','.svn','SCCS')): |
160 |
+ if ftype[x] == 1 and not \ |
161 |
+ (ignorecvs and os.path.basename(list[x]) in _ignorecvs_dirs): |
162 |
l,f = cacheddir(mypath+"/"+list[x], ignorecvs, ignorelist, EmptyOnError, |
163 |
followSymlinks) |
164 |
|
165 |
@@ -454,16 +460,22 @@ |
166 |
def child_nodes(self, node, ignore_priority=None): |
167 |
"""Return all children of the specified node""" |
168 |
if ignore_priority is None: |
169 |
- return self.nodes[node][0].keys() |
170 |
+ return list(self.nodes[node][0]) |
171 |
children = [] |
172 |
for child, priority in self.nodes[node][0].iteritems(): |
173 |
if priority > ignore_priority: |
174 |
children.append(child) |
175 |
return children |
176 |
|
177 |
- def parent_nodes(self, node): |
178 |
+ def parent_nodes(self, node, ignore_priority=None): |
179 |
"""Return all parents of the specified node""" |
180 |
- return self.nodes[node][1].keys() |
181 |
+ if ignore_priority is None: |
182 |
+ return list(self.nodes[node][1]) |
183 |
+ parents = [] |
184 |
+ for parent, priority in self.nodes[node][1].iteritems(): |
185 |
+ if priority > ignore_priority: |
186 |
+ parents.append(parent) |
187 |
+ return parents |
188 |
|
189 |
def leaf_nodes(self, ignore_priority=None): |
190 |
"""Return all nodes that have no children |