diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-08-06 18:00:30 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-08-06 18:00:30 -0700 |
commit | aa30da809919b9d9c6b75ef6e9d65076d19f47c9 (patch) | |
tree | d5986a97c0bccc07d9fdf4a2075805c07808c1c9 /pym | |
parent | Bug #331413 - Clarify the behavior of the =$CATEGORY/$PN-$VERSION* atom (diff) | |
download | portage-multirepo-aa30da809919b9d9c6b75ef6e9d65076d19f47c9.tar.gz portage-multirepo-aa30da809919b9d9c6b75ef6e9d65076d19f47c9.tar.bz2 portage-multirepo-aa30da809919b9d9c6b75ef6e9d65076d19f47c9.zip |
Fix _getMissingLicenses() package.license handling so that settings
from more specific atoms override those of less specific atoms.
Diffstat (limited to 'pym')
-rw-r--r-- | pym/portage/package/ebuild/config.py | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/pym/portage/package/ebuild/config.py b/pym/portage/package/ebuild/config.py index ff9894d8..34481054 100644 --- a/pym/portage/package/ebuild/config.py +++ b/pym/portage/package/ebuild/config.py @@ -1874,10 +1874,22 @@ class config(object): cp = cpv_getkey(cpv) cpdict = self._plicensedict.get(cp) if cpdict: - accept_license = list(self._accept_license) cpv_slot = "%s:%s" % (cpv, metadata["SLOT"]) - for atom in match_to_list(cpv_slot, list(cpdict)): - accept_license.extend(cpdict[atom]) + keys = list(cpdict) + plicence_list = [] + while keys: + bestmatch = best_match_to_list(cpv_slot, keys) + if bestmatch: + keys.remove(bestmatch) + plicence_list.append(cpdict[bestmatch]) + else: + break + if plicence_list: + # reverse, so the most specific atoms come last + plicence_list.reverse() + accept_license = list(self._accept_license) + for x in plicence_list: + accept_license.extend(x) licenses = set(flatten(use_reduce(paren_reduce( metadata["LICENSE"]), matchall=1))) |