<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"><<a href="mailto:rpjday@crashcourse.ca" target="_blank">rpjday@crashcourse.ca</a>></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="">
> next, if the possibilities in a list are REs, what is the<br>
> point of explicitly listing, say, "qemuarm|qemuarm64"? would<br>
> not the RE "qemuarm" subsume the more explicit "qemuarm64"?<br>
> same for the other architectures. (one could suggest that that<br>
> entire line could be shortened to "... = (^qemu)".)<br>
><br>
> Just qemu would potentially match future qemu machines which aren’t<br>
> actually supported, so I don’t think that would be appropriate. It’d<br>
> 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>
"qemuarm", 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="">
> the above seems pretty clear since the following lines would appear<br>
> to say that *only* the qemux86 is compatible:<br>
><br>
> linux-yocto-tiny_4.1.bb:COMPAT<wbr>IBLE_MACHINE = "(qemux86$)"<br>
> linux-yocto-tiny_4.4.bb:COMPAT<wbr>IBLE_MACHINE = "(qemux86$)"<br>
> linux-yocto-tiny_4.8.bb:COMPAT<wbr>IBLE_MACHINE = "(qemux86$)"<br>
><br>
> which suggests the following passage from the YP kernel dev manual is<br>
> a bit misleading:<br>
><br>
> "You must change it to match a list of the machines that your new<br>
> recipe supports. For example, to support the qemux86 and qemux86-64<br>
> machines, use the following form:<br>
><br>
> COMPATIBLE_MACHINE = "qemux86|qemux86-64"<br>
><br>
> and if all this is true, then if you're introducing a new machine, to<br>
> be magnificently pedantic, one should not use:<br>
><br>
> COMPATIBLE_MACHINE_machinename = "machinename"<br>
><br>
> but<br>
><br>
> COMPATIBLE_MACHINE_machinename = "^machinename$"<br>
><br>
> just to play it safe. am i reading all this correctly?<br>
><br>
><br>
> Yes, that’s correct, though we need the trailing $ but not the<br>
> leading ^, as it’s using re.match, not re.search — meaning it only<br>
> matches at the beginning of the string, it doesn’t search the string<br>
> 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>