From: Sebastian Luther Date: Wed, 11 Aug 2010 10:50:13 +0000 (+0200) Subject: Make sure we don't allow IUSE defaults in EAPIs that don't allow them X-Git-Tag: v2.2_rc68~297 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=220d52b671255239b7159ebc9321c3e64dce97a8;p=portage.git Make sure we don't allow IUSE defaults in EAPIs that don't allow them --- diff --git a/pym/_emerge/Package.py b/pym/_emerge/Package.py index 58c453ff9..992851bb1 100644 --- a/pym/_emerge/Package.py +++ b/pym/_emerge/Package.py @@ -8,6 +8,7 @@ import portage from portage.cache.mappings import slot_dict_class from portage.dep import isvalidatom, use_reduce, \ paren_enclose, _slot_re +from portage.eapi import eapi_has_iuse_defaults from _emerge.Task import Task if sys.hexversion >= 0x3000000: @@ -47,6 +48,10 @@ class Package(Task): # Avoid an InvalidAtom exception when creating slot_atom. # This package instance will be masked due to empty SLOT. slot = '0' + if (self.iuse.enabled or self.iuse.enabled) and \ + not eapi_has_iuse_defaults(self.metadata["EAPI"]): + self._invalid_metadata('IUSE.invalid', + "IUSE contains defaults, but EAPI doesn't allow them") self.slot_atom = portage.dep.Atom("%s:%s" % (self.cp, slot)) self.category, self.pf = portage.catsplit(self.cpv) self.cpv_split = portage.catpkgsplit(self.cpv) diff --git a/pym/portage/tests/resolver/test_eapi.py b/pym/portage/tests/resolver/test_eapi.py index a18b2c7c6..94cdd4a99 100644 --- a/pym/portage/tests/resolver/test_eapi.py +++ b/pym/portage/tests/resolver/test_eapi.py @@ -54,7 +54,7 @@ class EAPITestCase(TestCase): } requests = ( - #~ (["=dev-libs/A-1.0"], {}, None, False, None), + (["=dev-libs/A-1.0"], {}, None, False, None), (["=dev-libs/A-1.1"], {}, None, True, ["dev-libs/A-1.1"]), (["=dev-libs/A-1.2"], {}, None, True, ["dev-libs/A-1.2"]), (["=dev-libs/A-1.3"], {}, None, True, ["dev-libs/A-1.3"]),