diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-05-11 14:49:29 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-05-11 14:49:29 -0700 |
commit | 95054d7ff5c2491ae1f9159ca973b71f99bfd297 (patch) | |
tree | c641130ea4188ce8f9df78dfd6a8820ac6cee434 | |
parent | d31e55509111490d44de60c579e12473ad52a447 (diff) | |
download | portage-95054d7ff5c2491ae1f9159ca973b71f99bfd297.tar.gz portage-95054d7ff5c2491ae1f9159ca973b71f99bfd297.tar.bz2 portage-95054d7ff5c2491ae1f9159ca973b71f99bfd297.zip |
config: propagate SYNC to self.repositories
This resolves a circular dependency on the SYNC variable, which is
useful for bug #414961, since we want to be able to initialize
self.repositories before the SYNC variable is known.
-rw-r--r-- | pym/portage/package/ebuild/config.py | 8 | ||||
-rw-r--r-- | pym/portage/repository/config.py | 7 |
2 files changed, 6 insertions, 9 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 0cd35a804..8941de006 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -523,8 +523,7 @@ class config(object): #filling PORTDIR and PORTDIR_OVERLAY variable for compatibility main_repo = self.repositories.mainRepo() if main_repo is not None: - main_repo = main_repo.user_location - self["PORTDIR"] = main_repo + self["PORTDIR"] = main_repo.user_location self.backup_changes("PORTDIR") # repoman controls PORTDIR_OVERLAY via the environment, so no @@ -785,6 +784,11 @@ class config(object): self[k] = self[k].lower() self.backup_changes(k) + if main_repo is not None and not main_repo.sync: + main_repo_sync = self.get("SYNC") + if main_repo_sync: + main_repo.sync = main_repo_sync + # The first constructed config object initializes these modules, # and subsequent calls to the _init() functions have no effect. portage.output._init(config_root=self['PORTAGE_CONFIGROOT']) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index defdb47c8..e544c57f3 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -483,13 +483,6 @@ class RepoConfigLoader(object): prepos_order = [repo.name for (key, repo) in prepos_order if repo.name == key and repo.location is not None] - 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 or \ prepos['DEFAULT'].main_repo not in prepos: #setting main_repo if it was not set in repos.conf |