From: Zac Medico Date: Wed, 19 Jun 2013 19:10:48 +0000 (-0700) Subject: RepoConfigLoader: handle equal priorities X-Git-Tag: v2.2.0_alpha182~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2a65e8affdb5c8dd3830ce40809729c7a53fc1d1;p=portage.git RepoConfigLoader: handle equal priorities Include repo.name in sort key, for predictable sorting even when priorities are equal. --- diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py index 7c69fb426..7de695449 100644 --- a/pym/portage/repository/config.py +++ b/pym/portage/repository/config.py @@ -616,9 +616,13 @@ class RepoConfigLoader(object): # This happens if main-repo has been set in repos.conf. prepos[main_repo].priority = -1000 + # Include repo.name in sort key, for predictable sorting + # even when priorities are equal. + prepos_order = sorted(prepos.items(), + key=lambda r:(r[1].priority or 0, repo.name)) + # 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]