From: Zac Medico Date: Mon, 9 Aug 2010 10:35:45 +0000 (-0700) Subject: Fix /etc/portage/package.keywords handling so that more specific X-Git-Tag: v2.2_rc68~353 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=0432135c5213c710ecbc6cdc9e50adfc0d8daa22;p=portage.git Fix /etc/portage/package.keywords handling so that more specific atoms override less specific atoms. --- diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index 74a158f45..23d7f219d 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()