<div dir="ltr"><div>Hi,</div><div>The intention of this patch was to, let parse recipe files against all PATTERNS.</div><div>So that, the correct priority of recipe file with respect to pattern is returned.</div><div>As you agree, currently the first match is being returned, I believe this is not expected behaviour.</div><div>As per the function name, it should check the bbfile priority and return the corrosponding value.</div><div>I don&#39;t know much about priority assignments to layers and this patches implications.</div><div><br></div><div>I have modified the patch and submitted now.</div><div>Request you to provide your feedback and suggestions for possible improvements.</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Oct 7, 2017 at 3:31 PM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</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="HOEnZb"><div class="h5">On Fri, 2017-10-06 at 13:37 -0700, Andre McCurdy wrote:<br>
&gt; &gt;<br>
&gt; &gt; On Tue, Sep 27, 2016 at 11:54 AM, Mounesh Sutar &lt;mounesh.sutar@gmai<br>
&gt; &gt; <a href="http://l.com" rel="noreferrer" target="_blank">l.com</a>&gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; bitbake is parsing all recipe files, against layers<br>
&gt; &gt; &gt; BBFILE_PATTERN for<br>
&gt; &gt; &gt; warning message display.<br>
&gt; &gt; &gt; In case of sublayer with lower/equal priority, then all<br>
&gt; &gt; &gt; sublayer&#39;s<br>
&gt; &gt; &gt; patterns are not being<br>
&gt; &gt; &gt; considered for pattern match. While checking recipe file against<br>
&gt; &gt; &gt; matching<br>
&gt; &gt; &gt; pattern,<br>
&gt; &gt; &gt; the first matching pattern is accepted and added to matched list,<br>
&gt; &gt; &gt; while<br>
&gt; &gt; &gt; remaning PATTERNs are<br>
&gt; &gt; &gt; not being considered. With this, the recipes are being neglected<br>
&gt; &gt; &gt; from<br>
&gt; &gt; &gt; PATTERN match.<br>
&gt; &gt; &gt; This fix let&#39;s parser run through all the layers PATTERNs and on<br>
&gt; &gt; &gt; matching<br>
&gt; &gt; &gt; added to match list.<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Upstream-Status: Submitted [<a href="mailto:bitbake-devel@lists.openembedded.org">bitbake-devel@lists.<wbr>openembedded.org</a>]<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; Signed-off-by: Mounesh Sutar &lt;<a href="mailto:mounesh_sutar@mentor.com">mounesh_sutar@mentor.com</a>&gt;<br>
&gt; &gt; &gt; ---<br>
&gt; &gt; &gt;  bitbake/lib/bb/cooker.py |    2 +-<br>
&gt; &gt; &gt;  1 file changed, 1 insertion(+), 1 deletion(-)<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt; diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py<br>
&gt; &gt; &gt; index 4df8881..5fde995 100644<br>
&gt; &gt; &gt; --- a/bitbake/lib/bb/cooker.py<br>
&gt; &gt; &gt; +++ b/bitbake/lib/bb/cooker.py<br>
&gt; &gt; &gt; @@ -1705,7 +1705,7 @@ class CookerCollectFiles(object):<br>
&gt; &gt; &gt;                  if matched != None:<br>
&gt; &gt; &gt;                      if not regex in matched:<br>
&gt; &gt; &gt;                          <wbr>matched.add(regex)<br>
&gt; &gt; &gt; -                return pri<br>
&gt; &gt; &gt; +                        <wbr>return pri<br>
&gt; &gt; &gt;          return 0<br>
&gt; &gt; &gt;<br>
&gt; &gt; &gt;      def get_bbfiles(self):<br>
&gt; &gt; &gt; --<br>
&gt; Resurrecting an old thread as it&#39;s been pointed out to me that this<br>
&gt; patch fixes the issue I raised a while ago on the oe-core list:<br>
&gt;<br>
&gt;   <a href="http://lists.openembedded.org/pipermail/openembedded-core/2016-July" rel="noreferrer" target="_blank">http://lists.openembedded.org/<wbr>pipermail/openembedded-core/<wbr>2016-July</a><br>
&gt; /123466.html<br>
&gt;<br>
&gt; Are there any problems or concerns with this change?<br>
<br>
</div></div>I had to go and look at this again but yes, there are problems with the<br>
patch:<br>
<br>
a) If matched = None, the function never returns a priority after this <br>
   change.<br>
b) Currently the first match is returned and also used in parallel for <br>
   the priority calculation. After the patch, the priority used would <br>
   be the last match found. The patch therefore reverses priority <br>
   assignments for layers.<br>
<br>
There is a definite problem here but the patch simply moves the<br>
goalposts, it doesn&#39;t actually fix it. It breaks the current behaviour<br>
too.<br>
<br>
Cheers,<br>
<br>
Richard<br>
<br>
</blockquote></div><br></div>