<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 28, 2013 at 12:31 PM, Phil Blundell <span dir="ltr"><<a href="mailto:pb@pbcl.net" target="_blank">pb@pbcl.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Tue, 2013-05-28 at 12:18 -0300, Otavio Salvador wrote:<br>
<br>
> + need_distro_features = d.getVar('REQUIRED_DISTRO_FEATURES',<br>
> True)<br>
> + if need_distro_features:<br>
> + need_distro_features = need_distro_features.split()<br>
> + distro_features = (d.getVar('DISTRO_FEATURES', True) or<br>
> "").split()<br>
> + for f in need_distro_features:<br>
> + if f in distro_features:<br>
> + break<br>
> + else:<br>
> + raise bb.parse.SkipPackage("missing required distro<br>
> feature %s (not in DISTRO_FEATURES)" % need_distro_features)<br>
<br>
</div>This is still not quite right. The error message says that the features<br>
it mentions are "not in DISTRO_FEATURES", but it appears to still be<br>
listing everything that's named in REQUIRED_DISTRO_FEATURES whether or<br>
not it is actually in DISTRO_FEATURES.<br>
<br>
Also you seem to be printing a Python list with %s, which will work but<br>
the results aren't especially pretty.<br>
<br>
Also also, on a stylistic point, the "for/if/break" construct is a bit<br>
ugly. You could perhaps consider something like:<br>
<br>
need_distro_features = need_distro_features.split()<br>
<div class="im">distro_features = (d.getVar('DISTRO_FEATURES', True) or "").split()<br>
</div>missing_distro_features = filter(lambda x: x not in distro_features, need_distro_features)<br>
if missing_distro_features:<br>
raise bb.parse.SkipPackage("missing required distro features: %s" % " ".join(missing_distro_features))<br></blockquote><div><br></div><div style>I dislike the 'required' my idea here was each item of the 'compat distro features' would be as an OR. Like</div>
<div style><br></div><div style>COMPATIBLE_DISTRO_FEATURE = "x11 wayland"</div><div style><br></div><div style>So *any* of those would make recipe to be parsed.</div><div> </div></div>-- <br>Otavio Salvador O.S. Systems<br>
<a href="http://www.ossystems.com.br" target="_blank">http://www.ossystems.com.br</a> <a href="http://projetos.ossystems.com.br" target="_blank">http://projetos.ossystems.com.br</a><br>Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750<br>
</div></div>