From c0ae3fb065c21ca857a3f51096adf174570b761b Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Mon, 24 Jun 2013 23:45:31 +0200 Subject: [PATCH] portage.repository.config.RepoConfigLoader: Fix __delitem__() and unimplement __setitem__(). --- pym/portage/repository/config.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 0a2dd0066..3d88f4851 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -784,13 +784,23 @@ class RepoConfigLoader(object): return self.prepos[self.get_name_for_location(location)] def __setitem__(self, repo_name, repo): - self.prepos[repo_name] = repo + # self.prepos[repo_name] = repo + raise NotImplementedError def __getitem__(self, repo_name): return self.prepos[repo_name] def __delitem__(self, repo_name): + location = self.prepos[repo_name].location del self.prepos[repo_name] + if repo_name in self.prepos_order: + self.prepos_order.remove(repo_name) + for k, v in self.location_map.copy().items(): + if v == repo_name: + del self.location_map[k] + if repo_name in self.treemap: + del self.treemap[repo_name] + self._repo_location_list = tuple(x for x in self._repo_location_list if x != location) def __iter__(self): for repo_name in self.prepos_order: -- 2.26.2