1 |
commit: 04f6d3402f671aae275a0408ee2a6cdd9cd74e7a |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Jun 23 02:35:42 2012 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Jun 23 02:35:42 2012 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=04f6d340 |
7 |
|
8 |
depgraph: fix bugs in force_reinstall handling |
9 |
|
10 |
--- |
11 |
pym/_emerge/depgraph.py | 86 ++++++++++++++++++++-------------------------- |
12 |
1 files changed, 37 insertions(+), 49 deletions(-) |
13 |
|
14 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
15 |
index 92c1061..b3ea964 100644 |
16 |
--- a/pym/_emerge/depgraph.py |
17 |
+++ b/pym/_emerge/depgraph.py |
18 |
@@ -1849,16 +1849,11 @@ class depgraph(object): |
19 |
self._dynamic_config._slot_pkg_map[dep.child.root].get( |
20 |
dep.child.slot_atom) is None: |
21 |
myarg = None |
22 |
- if dep.root == self._frozen_config.target_root: |
23 |
- try: |
24 |
- myarg = next(self._iter_atoms_for_pkg(dep.child)) |
25 |
- except StopIteration: |
26 |
- pass |
27 |
- except InvalidDependString: |
28 |
- if not dep.child.installed: |
29 |
- # This shouldn't happen since the package |
30 |
- # should have been masked. |
31 |
- raise |
32 |
+ try: |
33 |
+ myarg = next(self._iter_atoms_for_pkg(dep.child), None) |
34 |
+ except InvalidDependString: |
35 |
+ if not dep.child.installed: |
36 |
+ raise |
37 |
|
38 |
if myarg is None: |
39 |
# Existing child selection may not be valid unless |
40 |
@@ -1964,14 +1959,11 @@ class depgraph(object): |
41 |
self._dynamic_config._slot_pkg_map[dep.child.root].get( |
42 |
dep.child.slot_atom) is None: |
43 |
myarg = None |
44 |
- if dep.root == self._frozen_config.target_root: |
45 |
- try: |
46 |
- myarg = next(self._iter_atoms_for_pkg(dep.child)) |
47 |
- except StopIteration: |
48 |
- pass |
49 |
- except InvalidDependString: |
50 |
- if not dep.child.installed: |
51 |
- raise |
52 |
+ try: |
53 |
+ myarg = next(self._iter_atoms_for_pkg(dep.child), None) |
54 |
+ except InvalidDependString: |
55 |
+ if not dep.child.installed: |
56 |
+ raise |
57 |
|
58 |
if myarg is None: |
59 |
ignored = True |
60 |
@@ -3782,20 +3774,22 @@ class depgraph(object): |
61 |
True if the user has not explicitly requested for this package |
62 |
to be replaced (typically via an atom on the command line). |
63 |
""" |
64 |
- if "selective" not in self._dynamic_config.myparams and \ |
65 |
- pkg.root == self._frozen_config.target_root: |
66 |
- if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg, |
67 |
- modified_use=self._pkg_use_enabled(pkg)): |
68 |
- return True |
69 |
- try: |
70 |
- next(self._iter_atoms_for_pkg(pkg)) |
71 |
- except StopIteration: |
72 |
- pass |
73 |
- except portage.exception.InvalidDependString: |
74 |
- pass |
75 |
- else: |
76 |
- return False |
77 |
- return True |
78 |
+ if self._frozen_config.excluded_pkgs.findAtomForPackage(pkg, |
79 |
+ modified_use=self._pkg_use_enabled(pkg)): |
80 |
+ return True |
81 |
+ |
82 |
+ arg = False |
83 |
+ try: |
84 |
+ for arg, atom in self._iter_atoms_for_pkg(pkg): |
85 |
+ if arg.force_reinstall: |
86 |
+ return False |
87 |
+ except InvalidDependString: |
88 |
+ pass |
89 |
+ |
90 |
+ if "selective" in self._dynamic_config.myparams: |
91 |
+ return True |
92 |
+ |
93 |
+ return not arg |
94 |
|
95 |
class _AutounmaskLevel(object): |
96 |
__slots__ = ("allow_use_changes", "allow_unstable_keywords", "allow_license_changes", \ |
97 |
@@ -4249,16 +4243,15 @@ class depgraph(object): |
98 |
# above visibility checks are complete. |
99 |
|
100 |
myarg = None |
101 |
- if root == self._frozen_config.target_root: |
102 |
- try: |
103 |
- for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg): |
104 |
- if myarg.force_reinstall: |
105 |
- reinstall = True |
106 |
- break |
107 |
- except portage.exception.InvalidDependString: |
108 |
- if not installed: |
109 |
- # masked by corruption |
110 |
- continue |
111 |
+ try: |
112 |
+ for myarg, myarg_atom in self._iter_atoms_for_pkg(pkg): |
113 |
+ if myarg.force_reinstall: |
114 |
+ reinstall = True |
115 |
+ break |
116 |
+ except InvalidDependString: |
117 |
+ if not installed: |
118 |
+ # masked by corruption |
119 |
+ continue |
120 |
if not installed and myarg: |
121 |
found_available_arg = True |
122 |
|
123 |
@@ -7107,13 +7100,8 @@ class _dep_check_composite_db(dbapi): |
124 |
return ret[:] |
125 |
|
126 |
def _visible(self, pkg): |
127 |
- if pkg.installed and "selective" not in self._depgraph._dynamic_config.myparams: |
128 |
- try: |
129 |
- arg = next(self._depgraph._iter_atoms_for_pkg(pkg)) |
130 |
- except (StopIteration, portage.exception.InvalidDependString): |
131 |
- arg = None |
132 |
- if arg: |
133 |
- return False |
134 |
+ if pkg.installed and not self._depgraph._want_installed_pkg(pkg): |
135 |
+ return False |
136 |
if pkg.installed and \ |
137 |
(pkg.masks or not self._depgraph._pkg_visibility_check(pkg)): |
138 |
# Account for packages with masks (like KEYWORDS masks) |