diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-09-29 13:56:46 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-09-29 13:56:46 -0700 |
commit | de6790c02308ddac924d12be54e9c4e9906c8996 (patch) | |
tree | c309bd84fc61c6f02cc1a6116a079f76af6aeade /pym/portage | |
parent | 1fdbe21dc4694d02e3ccab940478b52ff627fc20 (diff) | |
download | portage-de6790c02308ddac924d12be54e9c4e9906c8996.tar.gz portage-de6790c02308ddac924d12be54e9c4e9906c8996.tar.bz2 portage-de6790c02308ddac924d12be54e9c4e9906c8996.zip |
Handle missing PORTDIR in RepoConfigLoader.mainRepo() and the
MaskManager constructor.
Diffstat (limited to 'pym/portage')
-rw-r--r-- | pym/portage/package/ebuild/_config/MaskManager.py | 5 | ||||
-rw-r--r-- | 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""" |