From f9e7b12db80b10e509f07ef3bb7bac65a0a7573d Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 18 Jun 2013 14:20:35 -0700 Subject: [PATCH] RepoConfigLoader: main-repo priority before sort --- pym/portage/repository/config.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 56a9ea493..40fe2c9c8 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -554,14 +554,6 @@ class RepoConfigLoader(object): location_map[repo.location] = name treemap[name] = repo.location - # filter duplicates from aliases, by only including - # items where repo.name == key - - prepos_order = sorted(prepos.items(), key=lambda r:r[1].priority or 0) - - prepos_order = [repo.name for (key, repo) in prepos_order - if repo.name == key and repo.location is not None] - main_repo = prepos['DEFAULT'].main_repo if main_repo is None or main_repo not in prepos: #setting main_repo if it was not set in repos.conf @@ -577,6 +569,13 @@ class RepoConfigLoader(object): # This happens if main-repo has been set in repos.conf. prepos[main_repo].priority = -1000 + # filter duplicates from aliases, by only including + # items where repo.name == key + prepos_order = sorted(prepos.items(), key=lambda r:r[1].priority or 0) + prepos_order = [repo.name for (key, repo) in prepos_order + if repo.name == key and key != 'DEFAULT' and + repo.location is not None] + self.prepos = prepos self.prepos_order = prepos_order self.ignored_repos = ignored_repos -- 2.26.2