RepoConfigLoader: PORTDIR/repos.conf interaction
authorZac Medico <zmedico@gentoo.org>
Tue, 23 Jul 2013 04:42:22 +0000 (21:42 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 23 Jul 2013 04:42:22 +0000 (21:42 -0700)
pym/portage/repository/config.py

index 232e9cba0681d57d2e7b50899a8b7ab44e7d7e41..e6d37a8270c9f2f458d254e96d65cc245e45bf71 100644 (file)
@@ -438,7 +438,9 @@ class RepoConfigLoader(object):
                                        if repos_conf_opts is not None:
                                                # Selectively copy only the attributes which
                                                # repos.conf is allowed to override.
-                                               for k in ('aliases', 'eclass_overrides', 'masters', 'priority'):
+                                               for k in ('aliases', 'eclass_overrides', 'masters',
+                                                       'priority', 'sync_cvs_repo', 'sync_type',
+                                                       'sync_uri'):
                                                        v = getattr(repos_conf_opts, k, None)
                                                        if v is not None:
                                                                setattr(repo, k, v)
@@ -480,7 +482,7 @@ class RepoConfigLoader(object):
                return portdir
 
        @staticmethod
-       def _parse(paths, prepos, ignored_map, ignored_location_map, local_config):
+       def _parse(paths, prepos, ignored_map, ignored_location_map, local_config, portdir):
                """Parse files in paths to load config"""
                parser = SafeConfigParser()
 
@@ -536,6 +538,14 @@ class RepoConfigLoader(object):
 
                        repo = RepoConfig(sname, optdict, local_config=local_config)
 
+                       if repo.location and \
+                               not exists_raise_eaccess(repo.location) and \
+                               prepos['DEFAULT'].main_repo == repo.name and \
+                               portdir and exists_raise_eaccess(portdir):
+                               optdict['location'] = portdir
+                               print optdict
+                               repo = RepoConfig(sname, optdict, local_config=local_config)
+
                        if repo.name != sname and not portage._sync_disabled_warnings:
                                writemsg_level("!!! %s\n" % _("Section name '%s' set in repos.conf differs from name '%s' set inside repository") %
                                        (sname, repo.name), level=logging.ERROR, noiselevel=-1)
@@ -593,7 +603,8 @@ class RepoConfigLoader(object):
 
                try:
                        self._parse(paths, prepos, ignored_map,
-                               ignored_location_map, settings.local_config)
+                               ignored_location_map, settings.local_config,
+                               portdir)
                except ConfigParserError as e:
                        writemsg(
                                _("!!! Error while reading repo config file: %s\n") % e,