diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-07-09 04:57:55 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-07-09 04:57:55 +0000 |
commit | 2d60a510e1eb5ecdd6b20135a14661db9761a407 (patch) | |
tree | cc2d920a00a9cd9b2b06944318c9a686cd7a46f8 | |
parent | d0fb18b6b0e205dfb0de99e590750fcd77662370 (diff) | |
download | portage-2d60a510e1eb5ecdd6b20135a14661db9761a407.tar.gz portage-2d60a510e1eb5ecdd6b20135a14661db9761a407.tar.bz2 portage-2d60a510e1eb5ecdd6b20135a14661db9761a407.zip |
Use a dict for depgraph params, so we can use it to store key/value pairs
and fix the depgraph so it doesn't use emerge options directly.
svn path=/main/trunk/; revision=13809
-rw-r--r-- | pym/_emerge/create_depgraph_params.py | 18 | ||||
-rw-r--r-- | pym/_emerge/depgraph.py | 8 |
2 files changed, 13 insertions, 13 deletions
diff --git a/pym/_emerge/create_depgraph_params.py b/pym/_emerge/create_depgraph_params.py index 78c79fe2d..77deb042d 100644 --- a/pym/_emerge/create_depgraph_params.py +++ b/pym/_emerge/create_depgraph_params.py @@ -12,11 +12,11 @@ def create_depgraph_params(myopts, myaction): # empty: pretend nothing is merged # complete: completely account for all known dependencies # remove: build graph for use in removing packages - myparams = set(["recurse"]) + myparams = {"recurse" : True} if myaction == "remove": - myparams.add("remove") - myparams.add("complete") + myparams["remove"] = True + myparams["complete"] = True return myparams if "--update" in myopts or \ @@ -24,15 +24,15 @@ def create_depgraph_params(myopts, myaction): "--reinstall" in myopts or \ "--noreplace" in myopts or \ "--selective" in myopts: - myparams.add("selective") + myparams["selective"] = True if "--emptytree" in myopts: - myparams.add("empty") - myparams.discard("selective") + myparams["empty"] = True + myparams.pop("selective", None) if "--nodeps" in myopts: - myparams.discard("recurse") + myparams.pop("recurse", None) if "--deep" in myopts: - myparams.add("deep") + myparams["deep"] = True if "--complete-graph" in myopts: - myparams.add("complete") + myparams["complete"] = True return myparams diff --git a/pym/_emerge/depgraph.py b/pym/_emerge/depgraph.py index 6689f33e3..cb31b76c8 100644 --- a/pym/_emerge/depgraph.py +++ b/pym/_emerge/depgraph.py @@ -2298,7 +2298,7 @@ class depgraph(object): self._select_package = self._select_pkg_from_graph already_deep = "deep" in self._dynamic_config.myparams if not already_deep: - self._dynamic_config.myparams.add("deep") + self._dynamic_config.myparams["deep"] = True for root in self._frozen_config.roots: required_set_names = self._frozen_config._required_set_names.copy() @@ -3384,7 +3384,7 @@ class depgraph(object): if have_uninstall_task and \ not complete and \ not unsolvable_blockers: - self._dynamic_config.myparams.add("complete") + self._dynamic_config.myparams["complete"] = True raise self._serialize_tasks_retry("") if unsolvable_blockers and \ @@ -4523,7 +4523,7 @@ class depgraph(object): self._dynamic_config._scheduler_graph = self._dynamic_config.digraph else: self._select_package = self._select_pkg_from_graph - self._dynamic_config.myparams.add("selective") + self._dynamic_config.myparams["selective"] = True # Always traverse deep dependencies in order to account for # potentially unsatisfied dependencies of installed packages. # This is necessary for correct --keep-going or --resume operation @@ -4536,7 +4536,7 @@ class depgraph(object): # deep depenedencies of a scheduled build, that build needs to # be cancelled. In order for this type of situation to be # recognized, deep traversal of dependencies is required. - self._dynamic_config.myparams.add("deep") + self._dynamic_config.myparams["deep"] = True favorites = resume_data.get("favorites") args_set = self._dynamic_config._sets["args"] |