From: Zac Medico Date: Tue, 18 Jun 2013 21:20:35 +0000 (-0700) Subject: RepoConfigLoader: main-repo priority before sort X-Git-Tag: v2.2.0_alpha181 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f9e7b12db80b10e509f07ef3bb7bac65a0a7573d;p=portage.git RepoConfigLoader: main-repo priority before sort --- 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