From 2a65e8affdb5c8dd3830ce40809729c7a53fc1d1 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 19 Jun 2013 12:10:48 -0700 Subject: [PATCH] RepoConfigLoader: handle equal priorities Include repo.name in sort key, for predictable sorting even when priorities are equal. --- pym/portage/repository/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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] -- 2.26.2