diff options
author | Zac Medico <zmedico@gentoo.org> | 2007-10-24 06:42:39 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2007-10-24 06:42:39 +0000 |
commit | 9e0b55b48dffbd0d36e211edd7b66beb23d551ce (patch) | |
tree | 3d83152e098279e3ca224aaa7aa3ee1f2dc3848d | |
parent | e182308beebaa613a82b4c5506a825c11287250f (diff) | |
download | portage-9e0b55b48dffbd0d36e211edd7b66beb23d551ce.tar.gz portage-9e0b55b48dffbd0d36e211edd7b66beb23d551ce.tar.bz2 portage-9e0b55b48dffbd0d36e211edd7b66beb23d551ce.zip |
Add back support for helpful `emaint --check world` suggestions
and also show package masking reasons when appropriate.
svn path=/main/trunk/; revision=8269
-rw-r--r-- | pym/_emerge/__init__.py | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 282c9b4e3..147b361e7 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1517,6 +1517,17 @@ class depgraph(object): return 0 return 1 + def _get_parent_sets(self, root, atom): + refs = [] + for set_name, atom_set in self._sets.iteritems(): + if set_name in refs: + continue + if atom in atom_set: + refs.append(set_name) + if len(refs) > 1 and "args" in refs: + refs.remove("args") + return refs + def select_files(self, myfiles, mysets): "given a list of .tbz2s, .ebuilds and deps, create the appropriate depgraph and return a favorite list" self._sets.update(mysets) @@ -1657,6 +1668,10 @@ class depgraph(object): self._populate_filtered_repo(myroot, atom) pkg, existing_node = self._select_package(myroot, atom) if not pkg: + refs = self._get_parent_sets(myroot, atom) + if len(refs) == 1 and "args" in refs: + self._show_unsatisfied_dep(myroot, atom) + return 0, myfavorites self._missing_args.append((arg, atom)) continue if not self.create(pkg, addme=addme): @@ -3260,7 +3275,23 @@ class depgraph(object): print bold('*'+revision) sys.stdout.write(text) + # TODO: Add generic support for "set problem" handlers so that + # the below warnings aren't special cases for world only. if self._missing_args: + world_problems = False + if "world" in self._sets: + for arg, atom in self._missing_args: + if "world" in self._get_parent_sets( + self.target_root, atom): + world_problems = True + break + + if world_problems: + sys.stderr.write("\n!!! Problems have been " + \ + "detected with your world file\n") + sys.stderr.write("!!! Please run " + \ + green("emaint --check world")+"\n\n") + sys.stderr.write("\n" + colorize("BAD", "!!!") + \ " Ebuilds for the following packages are either all\n") sys.stderr.write(colorize("BAD", "!!!") + \ @@ -3273,14 +3304,7 @@ class depgraph(object): for arg_atom in self._pprovided_args: arg, atom = arg_atom refs = arg_refs.setdefault(arg_atom, []) - cp = portage.dep_getkey(atom) - for set_name, atom_set in self._sets.iteritems(): - if set_name in refs: - continue - if atom in atom_set: - refs.append(set_name) - if len(refs) > 1 and "args" in refs: - refs.remove("args") + refs.extend(self._get_parent_sets(self.target_root, atom)) msg = [] msg.append(bad("\nWARNING: ")) if len(self._pprovided_args) > 1: |