1 |
commit: dd5175a7e851a12f5740c2481c96b32e5db1f4eb |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Feb 2 04:09:50 2011 +0000 |
4 |
Commit: Thomas Sachau <tommy <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 2 04:09:50 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd5175a7 |
7 |
|
8 |
Show "missed update" message for REQUIRED_USE. |
9 |
|
10 |
This will fix bug #353443. |
11 |
|
12 |
--- |
13 |
pym/_emerge/depgraph.py | 38 +++++++++++++++++++++++++++++++------- |
14 |
1 files changed, 31 insertions(+), 7 deletions(-) |
15 |
|
16 |
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py |
17 |
index 64e9b19..16326ee 100644 |
18 |
--- a/pym/_emerge/depgraph.py |
19 |
+++ b/pym/_emerge/depgraph.py |
20 |
@@ -198,6 +198,9 @@ class _dynamic_depgraph_config(object): |
21 |
self._ignored_deps = [] |
22 |
self._highest_pkg_cache = {} |
23 |
|
24 |
+ self._unsat_req_use = {} |
25 |
+ self._pkg_config_issues = {} |
26 |
+ |
27 |
self._needed_unstable_keywords = backtrack_parameters.needed_unstable_keywords |
28 |
self._needed_license_changes = backtrack_parameters.needed_license_changes |
29 |
self._needed_use_config_changes = backtrack_parameters.needed_use_config_changes |
30 |
@@ -350,15 +353,12 @@ class depgraph(object): |
31 |
|
32 |
def _show_missed_update(self): |
33 |
|
34 |
- if '--quiet' in self._frozen_config.myopts and \ |
35 |
- '--debug' not in self._frozen_config.myopts: |
36 |
- return |
37 |
- |
38 |
# In order to minimize noise, show only the highest |
39 |
# missed update from each SLOT. |
40 |
missed_updates = {} |
41 |
for pkg, mask_reasons in \ |
42 |
- self._dynamic_config._runtime_pkg_mask.items(): |
43 |
+ chain(self._dynamic_config._runtime_pkg_mask.items(), |
44 |
+ self._dynamic_config._pkg_config_issues.items()): |
45 |
if pkg.installed: |
46 |
# Exclude installed here since we only |
47 |
# want to show available updates. |
48 |
@@ -382,6 +382,18 @@ class depgraph(object): |
49 |
missed_update_types.setdefault(mask_type, |
50 |
[]).append((pkg, parent_atoms)) |
51 |
|
52 |
+ if '--quiet' in self._frozen_config.myopts and \ |
53 |
+ '--debug' not in self._frozen_config.myopts: |
54 |
+ missed_update_types.pop("slot conflict", None) |
55 |
+ missed_update_types.pop("missing dependency", None) |
56 |
+ |
57 |
+ required_use = missed_update_types.pop("required use", None) |
58 |
+ if required_use is not None: |
59 |
+ # For display purposes, unsatisfied REQUIRED_USE |
60 |
+ # can be treated like a missing dependency. |
61 |
+ missed_update_types.setdefault("missing dependency", |
62 |
+ []).extend(required_use) |
63 |
+ |
64 |
self._show_missed_update_slot_conflicts( |
65 |
missed_update_types.get("slot conflict")) |
66 |
|
67 |
@@ -1890,7 +1902,14 @@ class depgraph(object): |
68 |
self._dynamic_config._unsatisfied_deps_for_display.append( |
69 |
((myroot, atom), {"myparent" : arg})) |
70 |
return 0, myfavorites |
71 |
- self._dynamic_config._missing_args.append((arg, atom)) |
72 |
+ pkg = self._dynamic_config._unsat_req_use.get((myroot, atom)) |
73 |
+ if pkg is not None: |
74 |
+ config_issues = \ |
75 |
+ self._dynamic_config._pkg_config_issues.setdefault(pkg, {}) |
76 |
+ parent_atoms = config_issues.setdefault("required use", set()) |
77 |
+ parent_atoms.add((arg, myroot, atom)) |
78 |
+ else: |
79 |
+ self._dynamic_config._missing_args.append((arg, atom)) |
80 |
continue |
81 |
if atom.cp != pkg.cp: |
82 |
# For old-style virtuals, we need to repeat the |
83 |
@@ -2653,7 +2672,7 @@ class depgraph(object): |
84 |
writemsg_stdout(" nothing similar found.\n" |
85 |
, noiselevel=-1) |
86 |
msg = [] |
87 |
- if not isinstance(myparent, AtomArg): |
88 |
+ if not isinstance(myparent, DependencyArg): |
89 |
# It's redundant to show parent for AtomArg since |
90 |
# it's the same as 'xinfo' displayed above. |
91 |
dep_chain = self._get_dep_chain(myparent, atom) |
92 |
@@ -3031,6 +3050,7 @@ class depgraph(object): |
93 |
# represented by the found_available_arg flag. |
94 |
found_available_arg = False |
95 |
packages_with_invalid_use_config = [] |
96 |
+ pkgs_with_unsat_req_use = [] |
97 |
for find_existing_node in True, False: |
98 |
if existing_node: |
99 |
break |
100 |
@@ -3246,6 +3266,7 @@ class depgraph(object): |
101 |
continue |
102 |
if not required_use_is_sat: |
103 |
packages_with_invalid_use_config.append(pkg) |
104 |
+ pkgs_with_unsat_req_use.append(pkg) |
105 |
continue |
106 |
|
107 |
if pkg.cp == atom_cp: |
108 |
@@ -3329,6 +3350,9 @@ class depgraph(object): |
109 |
break |
110 |
|
111 |
if not matched_packages: |
112 |
+ if pkgs_with_unsat_req_use: |
113 |
+ self._dynamic_config._unsat_req_use[(root, atom)] = \ |
114 |
+ pkgs_with_unsat_req_use[0] |
115 |
return None, None |
116 |
|
117 |
if "--debug" in self._frozen_config.myopts: |