From de6790c02308ddac924d12be54e9c4e9906c8996 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 29 Sep 2010 13:56:46 -0700 Subject: [PATCH] Handle missing PORTDIR in RepoConfigLoader.mainRepo() and the MaskManager constructor. --- pym/portage/package/ebuild/_config/MaskManager.py | 5 ++++- pym/portage/repository/config.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pym/portage/package/ebuild/_config/MaskManager.py b/pym/portage/package/ebuild/_config/MaskManager.py index db94ee501..70ded2dae 100644 --- a/pym/portage/package/ebuild/_config/MaskManager.py +++ b/pym/portage/package/ebuild/_config/MaskManager.py @@ -31,7 +31,10 @@ class MaskManager(object): recursive=1, remember_source_file=True, verify_eapi=True) masters = repo.masters if masters is None: - masters = [repositories.mainRepo()] + masters = [] + main_repo = repositories.mainRepo() + if main_repo is not None: + masters.append(main_repo) for master in masters: master_lines = grabfile_package(os.path.join(master.location, "profiles", "package.mask"), \ recursive=1, remember_source_file=True, verify_eapi=True) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index e79cddb70..73cddff42 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -245,7 +245,10 @@ class RepoConfigLoader(object): def mainRepo(self): """Returns the main repo""" - return self.prepos[self.prepos['DEFAULT'].main_repo] + maid_repo = self.prepos['DEFAULT'].main_repo + if maid_repo is None: + return None + return self.prepos[maid_repo] def _check_locations(self): """Check if repositories location are correct and show a warning message if not""" -- 2.26.2