diff options
author | Sebastian Luther <SebastianLuther@gmx.de> | 2010-10-03 20:04:35 +0200 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-10-03 12:05:56 -0700 |
commit | e682535a9f42213b65da11634cf10121957c852c (patch) | |
tree | c569b3f19fae3e40f21497e6d14bf53a1fc3ffb1 | |
parent | cf59cab2bdbd0e1d838cf2f5ee9c61b6f02ff3ac (diff) | |
download | portage-e682535a9f42213b65da11634cf10121957c852c.tar.gz portage-e682535a9f42213b65da11634cf10121957c852c.tar.bz2 portage-e682535a9f42213b65da11634cf10121957c852c.zip |
Handle invalid PORTDIR and realpath issues
-rw-r--r-- | pym/portage/repository/config.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 29116c176..bbe62229a 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -256,7 +256,7 @@ class RepoConfigLoader(object): ignored_map = {} ignored_location_map = {} - portdir = settings.get('PORTDIR', '') + portdir = os.path.realpath(settings.get('PORTDIR', '')) portdir_overlay = settings.get('PORTDIR_OVERLAY', '') parse(paths, prepos, ignored_map, ignored_location_map) add_overlays(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map) @@ -304,22 +304,22 @@ class RepoConfigLoader(object): prepos_order = [repo.name for repo in prepos.values() if repo.location is not None] prepos_order.sort(key=repo_priority, reverse=True) - if portdir: - if portdir not in location_map: - portdir = prepos[ignored_location_map[portdir]].location + if portdir in location_map: portdir_repo = prepos[location_map[portdir]] portdir_sync = settings.get('SYNC', '') #if SYNC variable is set and not overwritten by repos.conf if portdir_sync and not portdir_repo.sync: portdir_repo.sync = portdir_sync - if prepos['DEFAULT'].main_repo is None: + if prepos['DEFAULT'].main_repo is None or \ + prepos['DEFAULT'].main_repo not in prepos: #setting main_repo if it was not set in repos.conf if portdir in location_map: prepos['DEFAULT'].main_repo = location_map[portdir] elif portdir in ignored_location_map: prepos['DEFAULT'].main_repo = ignored_location_map[portdir] else: + prepos['DEFAULT'].main_repo = None writemsg(_("!!! main-repo not set in DEFAULT and PORTDIR is empty. \n"), noiselevel=-1) self.prepos = prepos |