diff options
author | Zac Medico <zmedico@gentoo.org> | 2011-06-20 20:27:38 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2011-06-20 20:27:38 -0700 |
commit | 96ab3f8e703138bbbda0c50bb05998281207a4d4 (patch) | |
tree | 7bbe17b265593948e6c95d3ad559816d77471ec5 | |
parent | 33b197b02574c0f49d4dce659562d2f3362e5eba (diff) | |
download | portage-96ab3f8e703138bbbda0c50bb05998281207a4d4.tar.gz portage-96ab3f8e703138bbbda0c50bb05998281207a4d4.tar.bz2 portage-96ab3f8e703138bbbda0c50bb05998281207a4d4.zip |
config: fix repo KeyErrors
-rw-r--r-- | pym/portage/package/ebuild/_config/UseManager.py | 18 | ||||
-rw-r--r-- | pym/portage/package/ebuild/config.py | 10 |
2 files changed, 24 insertions, 4 deletions
diff --git a/pym/portage/package/ebuild/_config/UseManager.py b/pym/portage/package/ebuild/_config/UseManager.py index 67e92944e..d7ef0f6b0 100644 --- a/pym/portage/package/ebuild/_config/UseManager.py +++ b/pym/portage/package/ebuild/_config/UseManager.py @@ -147,7 +147,14 @@ class UseManager(object): cp = cpv_getkey(remove_slot(pkg)) usemask = [] if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO: - for repo in [repo.name for repo in self.repositories[pkg.repo].masters] + [pkg.repo]: + repos = [] + try: + repos.extend(repo.name for repo in + self.repositories[pkg.repo].masters) + except KeyError: + pass + repos.append(pkg.repo) + for repo in repos: usemask.append(self._repo_usemask_dict.get(repo, {})) cpdict = self._repo_pusemask_dict.get(repo, {}).get(cp) if cpdict: @@ -174,7 +181,14 @@ class UseManager(object): cp = cpv_getkey(remove_slot(pkg)) useforce = [] if hasattr(pkg, "repo") and pkg.repo != Package.UNKNOWN_REPO: - for repo in [repo.name for repo in self.repositories[pkg.repo].masters] + [pkg.repo]: + repos = [] + try: + repos.extend(repo.name for repo in + self.repositories[pkg.repo].masters) + except KeyError: + pass + repos.append(pkg.repo) + for repo in repos: useforce.append(self._repo_useforce_dict.get(repo, {})) cpdict = self._repo_puseforce_dict.get(repo, {}).get(cp) if cpdict: diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 6b7af51e9..c8ea1c86e 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1127,8 +1127,14 @@ class config(object): repo_env = [] repo_env_empty = True if repository and repository != Package.UNKNOWN_REPO: - for repo in [repo.name for - repo in self.repositories[repository].masters] + [repository]: + repos = [] + try: + repos.extend(repo.name for repo in + self.repositories[repository].masters) + except KeyError: + pass + repos.append(repository) + for repo in repos: d = self._repo_make_defaults.get(repo) if d is None: d = {} |