[OE-core] a style guide entry for using BBMASK?

Chris Larson clarson at kergoth.com
Wed Jan 9 15:31:01 UTC 2013


On Wed, Jan 9, 2013 at 6:09 AM, Robert P. J. Day <rpjday at crashcourse.ca>wrote:

>   is there a *preferred* format for setting BBMASK?  in my travels,
> i've seen variations such as:
>
>   "dir/dir"
>   "dir/dir/"
>   "dir/dir/*"
>   ".*/dir/dir"
>
> and so on.  is there an aesthetic preference of any kind?
>


It's just a regular expression, so as long as it matches, we're fine, but
that said, there are certain things to keep in mind:

- First, 'dir/dir' will also match 'foodir/dirbar', which while an unlikely
case, is something you should avoid, and this is what having the
leading/trailing slashes helps you avoid. It's not as unlikely as it seems,
also. Consider something like recipes/libfoo/ and recipes/libfoobar/
- It uses re.search, not re.match, so the leading .* is unnecessary
- /* will only match a series of slashes, not "anything" — that sounds like
a case of someone thinking it's a glob when it's actually a regex. further,
without a ^ to anchor the end of the expression, there's no need to match
anything past what you're searching for (that is, no need to do something
like dir/dir/.*)

So given those points, I'd suggest the form of BBMASK = "/dir/dir/" — note
the leading and trailing slashes to ensure it doesn't match anything that
doesn't exactly match those directories.
-- 
Christopher Larson
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20130109/f93fa880/attachment-0002.html>


More information about the Openembedded-core mailing list