From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id A18E91381F3 for ; Wed, 19 Jun 2013 19:11:17 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0430AE0960; Wed, 19 Jun 2013 19:11:13 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 92924E0960 for ; Wed, 19 Jun 2013 19:11:12 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 586C233E481 for ; Wed, 19 Jun 2013 19:11:11 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id A06CEE468F for ; Wed, 19 Jun 2013 19:11:09 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1371669048.2a65e8affdb5c8dd3830ce40809729c7a53fc1d1.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/repository/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/repository/config.py X-VCS-Directories: pym/portage/repository/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 2a65e8affdb5c8dd3830ce40809729c7a53fc1d1 X-VCS-Branch: master Date: Wed, 19 Jun 2013 19:11:09 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 3e7a23a2-1bea-4318-86d3-74b484860394 X-Archives-Hash: f08286c60fe94116c4568f06059e31f5 commit: 2a65e8affdb5c8dd3830ce40809729c7a53fc1d1 Author: Zac Medico gentoo org> AuthorDate: Wed Jun 19 19:10:48 2013 +0000 Commit: Zac Medico gentoo org> CommitDate: Wed Jun 19 19:10:48 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=2a65e8af 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 7c69fb4..7de6954 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]