<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">&lt;<a href="mailto:pb@pbcl.net" target="_blank">pb@pbcl.net</a>&gt;</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>
&gt; +        need_distro_features = d.getVar(&#39;REQUIRED_DISTRO_FEATURES&#39;,<br>
&gt; True)<br>
&gt; +        if need_distro_features:<br>
&gt; +            need_distro_features = need_distro_features.split()<br>
&gt; +            distro_features = (d.getVar(&#39;DISTRO_FEATURES&#39;, True) or<br>
&gt; &quot;&quot;).split()<br>
&gt; +            for f in need_distro_features:<br>
&gt; +                if f in distro_features:<br>
&gt; +                    break<br>
&gt; +            else:<br>
&gt; +                raise bb.parse.SkipPackage(&quot;missing required distro<br>
&gt; feature %s (not in DISTRO_FEATURES)&quot; % need_distro_features)<br>
<br>
</div>This is still not quite right.  The error message says that the features<br>
it mentions are &quot;not in DISTRO_FEATURES&quot;, but it appears to still be<br>
listing everything that&#39;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&#39;t especially pretty.<br>
<br>
Also also, on a stylistic point, the &quot;for/if/break&quot; 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(&#39;DISTRO_FEATURES&#39;, True) or &quot;&quot;).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(&quot;missing required distro features: %s&quot; % &quot; &quot;.join(missing_distro_features))<br></blockquote><div><br></div><div style>I dislike the &#39;required&#39; my idea here was each item of the &#39;compat distro features&#39; would be as an OR. Like</div>
<div style><br></div><div style>COMPATIBLE_DISTRO_FEATURE = &quot;x11 wayland&quot;</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>