diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-09 03:35:45 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-09 03:35:45 -0700 |
commit | 0432135c5213c710ecbc6cdc9e50adfc0d8daa22 (patch) | |
tree | 023e8fb0e6389860c34e311d52155606d1c8fa36 | |
parent | e413d6cdb0ca36919155a839927370350a8448c5 (diff) | |
download | portage-0432135c5213c710ecbc6cdc9e50adfc0d8daa22.tar.gz portage-0432135c5213c710ecbc6cdc9e50adfc0d8daa22.tar.bz2 portage-0432135c5213c710ecbc6cdc9e50adfc0d8daa22.zip |
Fix /etc/portage/package.keywords handling so that more specific
atoms override less specific atoms.
-rw-r--r-- | pym/portage/package/ebuild/config.py | 22 |
1 files changed, 17 insertions, 5 deletions
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() |