From 0432135c5213c710ecbc6cdc9e50adfc0d8daa22 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 9 Aug 2010 03:35:45 -0700 Subject: Fix /etc/portage/package.keywords handling so that more specific atoms override less specific atoms. --- pym/portage/package/ebuild/config.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 74a158f4..23d7f219 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1817,11 +1817,23 @@ class config(object): pkgdict = self.pkeywordsdict.get(cp) matches = False if pkgdict: - cpv_slot_list = ["%s:%s" % (cpv, metadata["SLOT"])] - for atom, pkgkeywords in pkgdict.items(): - if match_from_list(atom, cpv_slot_list): - matches = True - pgroups.extend(pkgkeywords) + cpv_slot = "%s:%s" % (cpv, metadata["SLOT"]) + pkg_accept_keywords = [] + keys = list(pkgdict) + while keys: + best_match = best_match_to_list(cpv_slot, keys) + if best_match: + keys.remove(best_match) + pkg_accept_keywords.append(pkgdict[best_match]) + else: + break + if pkg_accept_keywords: + # reverse, so the most specific atoms come last + pkg_accept_keywords.reverse() + for x in pkg_accept_keywords: + pgroups.extend(x) + matches = True + if matches or egroups: pgroups.extend(egroups) inc_pgroups = set() -- cgit v1.2.3-65-gdbad