diff options
author | Marius Mauch <genone@gentoo.org> | 2007-10-16 16:14:31 +0000 |
---|---|---|
committer | Marius Mauch <genone@gentoo.org> | 2007-10-16 16:14:31 +0000 |
commit | 4492e372e4246a3802d09fc311c081cff21ccea8 (patch) | |
tree | b8bfd07e0556c2a7c929e321053702170f8303f3 | |
parent | 99cc8049b115319c233d8f05e7d7df8bdad1f657 (diff) | |
download | portage-4492e372e4246a3802d09fc311c081cff21ccea8.tar.gz portage-4492e372e4246a3802d09fc311c081cff21ccea8.tar.bz2 portage-4492e372e4246a3802d09fc311c081cff21ccea8.zip |
Also use EmergeConfig() in MergeTask
svn path=/main/trunk/; revision=8147
-rw-r--r-- | pym/_emerge/__init__.py | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 5eda18d74..f833f487f 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -363,8 +363,17 @@ def create_depgraph_params(myopts, myaction): class EmergeConfig(portage.config): - def __init__(self, portage_config, setconfig): - portage.config.__init__(self, clone=portage_config) + def __init__(self, settings, trees=None, setconfig=None): + """ You have to specify one of trees or setconfig """ + portage.config.__init__(self, clone=settings) + if not setconfig: + setconfigpaths = [os.path.join(GLOBAL_CONFIG_PATH, "sets.conf")] + setconfigpaths.append(os.path.join(settings["PORTDIR"], "sets.conf")) + setconfigpaths += [os.path.join(x, "sets.conf") for x in settings["PORDIR_OVERLAY"].split()] + setconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"], + USER_CONFIG_PATH.lstrip(os.path.sep), "sets.conf")) + #setconfig = SetConfig(setconfigpaths, settings, trees[settings["ROOT"]]) + setconfig = make_default_config(settings, trees[settings["ROOT"]]) self.setconfig = setconfig # search functionality @@ -3720,10 +3729,10 @@ class MergeTask(object): if settings.get("PORTAGE_DEBUG", "") == "1": self.edebug = 1 self.pkgsettings = {} - self.pkgsettings[self.target_root] = portage.config(clone=settings) + self.pkgsettings[self.target_root] = EmergeConfig(settings, setconfig=settings.setconfig) if self.target_root != "/": self.pkgsettings["/"] = \ - portage.config(clone=trees["/"]["vartree"].settings) + EmergeConfig(trees["/"]["vartree"].settings, setconfig=settings.setconfig) self.curval = 0 def merge(self, mylist, favorites, mtimedb): @@ -6379,24 +6388,16 @@ def load_emerge_config(trees=None): settings = trees["/"]["vartree"].settings - setconfigpaths = [os.path.join(GLOBAL_CONFIG_PATH, "sets.conf")] - setconfigpaths.append(os.path.join(settings["PORTDIR"], "sets.conf")) - setconfigpaths += [os.path.join(x, "sets.conf") for x in settings["PORDIR_OVERLAY"].split()] - setconfigpaths.append(os.path.join(settings["PORTAGE_CONFIGROOT"], - USER_CONFIG_PATH.lstrip(os.path.sep), "sets.conf")) - #setconfig = SetConfig(setconfigpaths, settings, trees[settings["ROOT"]]) - setconfig = make_default_config(settings, trees[settings["ROOT"]]) - del setconfigpaths - - settings = EmergeConfig(trees["/"]["vartree"].settings, setconfig) - for myroot in trees: if myroot != "/": settings = trees[myroot]["vartree"].settings break + + settings = EmergeConfig(settings, trees=trees) mtimedbfile = os.path.join("/", portage.CACHE_PATH.lstrip(os.path.sep), "mtimedb") mtimedb = portage.MtimeDB(mtimedbfile) + return settings, trees, mtimedb def adjust_config(myopts, settings): |