Bug #234478 - Fix config._getMissingLicenses() to only access USE when
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Aug 2008 07:12:32 +0000 (07:12 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 12 Aug 2008 07:12:32 +0000 (07:12 -0000)
LICENSE is conditional since otherwise USE hasn't necessarily been
calculated.

svn path=/main/trunk/; revision=11401

pym/portage/__init__.py

index d5b1867fa56de7f29c08d01940193669a956120d..49baf361ac15eb97187be5b0b0a5288ee573081b 100644 (file)
@@ -2357,9 +2357,15 @@ class config(object):
                        cpv_slot = "%s:%s" % (cpv, metadata["SLOT"])
                        for atom in match_to_list(cpv_slot, cpdict.keys()):
                                acceptable_licenses.update(cpdict[atom])
-               license_struct = portage.dep.paren_reduce(metadata["LICENSE"])
+
+               license_str = metadata["LICENSE"]
+               if "?" in license_str:
+                       use = metadata["USE"].split()
+               else:
+                       use = []
+
                license_struct = portage.dep.use_reduce(
-                       license_struct, uselist=metadata["USE"].split())
+                       portage.dep.paren_reduce(license_str), uselist=use)
                license_struct = portage.dep.dep_opconvert(license_struct)
                return self._getMaskedLicenses(license_struct, acceptable_licenses)