<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Dec 19, 2016 at 10:56 AM, Robert P. J. Day <span dir="ltr">&lt;<a href="mailto:rpjday@crashcourse.ca" target="_blank">rpjday@crashcourse.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":34m" class="a3s aXjCH m159183ba2b4bc17d">i suspected as much. still, would consistency dictate using<br>
parentheses or not? just a style thing.<br></div></blockquote><div><br></div><div>I think it’s largely personal preference. Personally, using a capture when we don’t need one is ugly to me, so I’d rather see it only used when needed, but that’s just my opinion. The upside to always using a capture is it makes it clearer, at a glance, to a new user that it’s not just a word or list of words, but a regular expression.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":34m" class="a3s aXjCH m159183ba2b4bc17d"><span class="">
&gt;       next, if the possibilities in a list are REs, what is the<br>
&gt;       point of explicitly listing, say, &quot;qemuarm|qemuarm64&quot;? would<br>
&gt;       not the RE &quot;qemuarm&quot; subsume the more explicit &quot;qemuarm64&quot;?<br>
&gt;       same for the other architectures. (one could suggest that that<br>
&gt;       entire line could be shortened to &quot;... = (^qemu)&quot;.)<br>
&gt;<br>
&gt; Just qemu would potentially match future qemu machines which aren’t<br>
&gt; actually supported, so I don’t think that would be appropriate. It’d<br>
&gt; match too much.<br>
<br>
</span>  i realized that, i was just being technical. :-) in any event, as it<br>
is, it would *still* match too much, anything starting with<br>
&quot;qemuarm&quot;, for example.<br></div></blockquote><div><br></div><div>Good point, yes. </div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":34m" class="a3s aXjCH m159183ba2b4bc17d"><span class="">
&gt;         the above seems pretty clear since the following lines would appear<br>
&gt;       to say that *only* the qemux86 is compatible:<br>
&gt;<br>
&gt;         linux-yocto-tiny_4.1.bb:COMPAT<wbr>IBLE_MACHINE = &quot;(qemux86$)&quot;<br>
&gt;         linux-yocto-tiny_4.4.bb:COMPAT<wbr>IBLE_MACHINE = &quot;(qemux86$)&quot;<br>
&gt;         linux-yocto-tiny_4.8.bb:COMPAT<wbr>IBLE_MACHINE = &quot;(qemux86$)&quot;<br>
&gt;<br>
&gt;       which suggests the following passage from the YP kernel dev manual is<br>
&gt;       a bit misleading:<br>
&gt;<br>
&gt;         &quot;You must change it to match a list of the machines that your new<br>
&gt;         recipe supports. For example, to support the qemux86 and qemux86-64<br>
&gt;         machines, use the following form:<br>
&gt;<br>
&gt;              COMPATIBLE_MACHINE = &quot;qemux86|qemux86-64&quot;<br>
&gt;<br>
&gt;       and if all this is true, then if you&#39;re introducing a new machine, to<br>
&gt;       be magnificently pedantic, one should not use:<br>
&gt;<br>
&gt;         COMPATIBLE_MACHINE_machinename = &quot;machinename&quot;<br>
&gt;<br>
&gt;       but<br>
&gt;<br>
&gt;         COMPATIBLE_MACHINE_machinename = &quot;^machinename$&quot;<br>
&gt;<br>
&gt;       just to play it safe. am i reading all this correctly?<br>
&gt;<br>
&gt;<br>
&gt; Yes, that’s correct, though we need the trailing $ but not the<br>
&gt; leading ^, as it’s using re.match, not re.search — meaning it only<br>
&gt; matches at the beginning of the string, it doesn’t search the string<br>
&gt; to find a match.<br>
<br>
</span>  ah, quite right, i had forgotten that. again, in any event, both the<br>
code and documentation could probably be tweaked to make all of this<br>
more obvious.</div></blockquote></div><br>Absolutely agreed. For this regex specifically, an argument could be made that a lack of a trailing $ is almost certainly a bug. I could argue that it should either be implicit, though that would be limiting, or failing to include it could trigger a warning unless you explicitly state you know what you’re doing :) Hmm..<br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Christopher Larson<br>clarson at kergoth dot com<br>Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics</div>
</div></div>