On Tue, 2013-05-28 at 12:18 -0300, Otavio Salvador wrote:
> + need_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES',
> True)
> + if need_distro_features:
> + need_distro_features = need_distro_features.split()
> + distro_features = (d.getVar('DISTRO_FEATURES', True) or
> "").split()
> + for f in need_distro_features:
> + if f in distro_features:
> + break
> + else:
> + raise bb.parse.SkipPackage("missing required distro
> feature %s (not in DISTRO_FEATURES)" % need_distro_features)
This is still not quite right. The error message says that the features
it mentions are "not in DISTRO_FEATURES", but it appears to still be
listing everything that's named in REQUIRED_DISTRO_FEATURES whether or
not it is actually in DISTRO_FEATURES.
Also you seem to be printing a Python list with %s, which will work but
the results aren't especially pretty.
Also also, on a stylistic point, the "for/if/break" construct is a bit
ugly. You could perhaps consider something like:
need_distro_features = need_distro_features.split()
distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()
missing_distro_features = filter(lambda x: x not in distro_features,
need_distro_features)
if missing_distro_features:
raise bb.parse.SkipPackage("missing required distro features: %s" % "
".join(missing_distro_features))
p.
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core