Revert "RepoConfigLoader: Recursively expand masters."
authorZac Medico <zmedico@gentoo.org>
Sun, 9 Oct 2011 19:09:22 +0000 (12:09 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 9 Oct 2011 19:09:22 +0000 (12:09 -0700)
This reverts commit ab2a6cc357ba3c8272a4a1556e2c0bcd4bee102e.
Reverting all masters recursion code for now (see bug #386569).

pym/portage/repository/config.py

index 1d042ac0e953410414790349eaf5d30b4c5c7328..8f55177116cccdfd6e73a6e601236f91493dec8b 100644 (file)
@@ -484,38 +484,32 @@ class RepoConfigLoader(object):
                self._prepos_changed = True
                self._repo_location_list = []
 
-               def get_masters(repo_name, repo, recurse=True):
-                       master_repos = []
+               #The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
+               for repo_name, repo in prepos.items():
+                       if repo_name == "DEFAULT":
+                               continue
                        if repo.masters is None:
                                if self.mainRepo() and repo_name != self.mainRepo().name:
-                                       master_repos = [self.mainRepo()]
+                                       repo.masters = self.mainRepo(),
                                else:
-                                       master_repos = []
+                                       repo.masters = ()
                        else:
-                               for master in repo.masters:
-                                       if isinstance(master, RepoConfig):
-                                               master_repos.append(master)
+                               if repo.masters and isinstance(repo.masters[0], RepoConfig):
+                                       # This one has already been processed
+                                       # because it has an alias.
+                                       continue
+                               master_repos = []
+                               for master_name in repo.masters:
+                                       if master_name not in prepos:
+                                               layout_filename = os.path.join(repo.user_location,
+                                                       "metadata", "layout.conf")
+                                               writemsg_level(_("Unavailable repository '%s' " \
+                                                       "referenced by masters entry in '%s'\n") % \
+                                                       (master_name, layout_filename),
+                                                       level=logging.ERROR, noiselevel=-1)
                                        else:
-                                               if master not in prepos:
-                                                       layout_filename = os.path.join(repo.user_location,
-                                                               "metadata", "layout.conf")
-                                                       writemsg_level(_("Unavailable repository '%s' " \
-                                                               "referenced by masters entry in '%s'\n") % \
-                                                               (master_name, layout_filename),
-                                                               level=logging.ERROR, noiselevel=-1)
-                                               else:
-                                                       master = prepos[master]
-                                                       if recurse:
-                                                               master_repos.extend(get_masters(master.name, master) + [master])
-                                                       else:
-                                                               master_repos.append(master)
-                       return master_repos
-
-               #The 'masters' key currently contains repo names. Replace them with the matching RepoConfig.
-               for repo_name, repo in prepos.items():
-                       if repo_name == "DEFAULT":
-                               continue
-                       repo.masters = tuple(get_masters(repo_name, repo))
+                                               master_repos.append(prepos[master_name])
+                               repo.masters = tuple(master_repos)
 
                #The 'eclass_overrides' key currently contains repo names. Replace them with the matching repo paths.
                for repo_name, repo in prepos.items():