diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-28 03:32:09 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-28 03:32:09 -0700 |
commit | 33a18d5dc2c3bb40d9b95c932e927b71321b2c31 (patch) | |
tree | bf9c87de153223c49159b6b00847afb5169252fd | |
parent | 35be6eb927cde7b18e3c4c5700feef937e08b1ed (diff) | |
download | portage-33a18d5dc2c3bb40d9b95c932e927b71321b2c31.tar.gz portage-33a18d5dc2c3bb40d9b95c932e927b71321b2c31.tar.bz2 portage-33a18d5dc2c3bb40d9b95c932e927b71321b2c31.zip |
Add basic repo atom support for emerge --resume.
-rw-r--r-- | pym/_emerge/depgraph.py | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index fc96bdd3f..69422f963 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -4974,6 +4974,14 @@ class depgraph(object): if not isinstance(mergelist, list): mergelist = [] + favorites = resume_data.get("favorites") + args_set = self._dynamic_config.sets[ + self._frozen_config.target_root].sets['__non_set_args__'] + if isinstance(favorites, list): + args = self._load_favorites(favorites) + else: + args = [] + fakedb = self._dynamic_config.mydbapi trees = self._frozen_config.trees serialized_tasks = [] @@ -4987,8 +4995,18 @@ class depgraph(object): if action != "merge": continue root_config = self._frozen_config.roots[myroot] + + # Use the resume "favorites" list to see if a repo was specified + # for this package. + depgraph_sets = self._dynamic_config.sets[root_config.root] + repo = None + for atom in depgraph_sets.atoms.getAtoms(): + if atom.repo and portage.dep.match_from_list(atom, [pkg_key]): + repo = atom.repo + break + try: - pkg = self._pkg(pkg_key, pkg_type, root_config) + pkg = self._pkg(pkg_key, pkg_type, root_config, myrepo=repo) except portage.exception.PackageNotFound: # It does no exist or it is corrupt. if skip_missing: @@ -5035,14 +5053,6 @@ class depgraph(object): # recognized, deep traversal of dependencies is required. self._dynamic_config.myparams["deep"] = True - favorites = resume_data.get("favorites") - args_set = self._dynamic_config.sets[ - self._frozen_config.target_root].sets['__non_set_args__'] - if isinstance(favorites, list): - args = self._load_favorites(favorites) - else: - args = [] - for task in serialized_tasks: if isinstance(task, Package) and \ task.operation == "merge": @@ -5142,7 +5152,7 @@ class depgraph(object): root_config=root_config)) else: try: - x = Atom(x) + x = Atom(x, allow_repo=True) except portage.exception.InvalidAtom: continue args.append(AtomArg(arg=x, atom=x, |