aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre McCurdy <armccurdy@gmail.com>2017-02-01 13:09:16 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-19 06:28:41 -0800
commit56ad67017e601c7e0f6085ca84e29c28d8d4519f (patch)
tree083fdf2192297aa86976a749d745432661be3aa6
parentd3e182bc18ff2894f1efc8aad3d508dd432c996e (diff)
downloadbitbake-56ad67017e601c7e0f6085ca84e29c28d8d4519f.tar.gz
cooker: detect malformed BBMASK expressions which begin with a separator
When constructing an older style single regex, it's possible for BBMASK to end up beginning with '|', which matches and masks _everything_. Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--lib/bb/cooker.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index ce84e1c74..662a7ac07 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -1900,6 +1900,11 @@ class CookerCollectFiles(object):
# that do not compile
bbmasks = []
for mask in bbmask.split():
+ # When constructing an older style single regex, it's possible for BBMASK
+ # to end up beginning with '|', which matches and masks _everything_.
+ if mask.startswith("|"):
+ collectlog.warn("BBMASK contains regular expression beginning with '|', fixing: %s" % mask)
+ mask = mask[1:]
try:
re.compile(mask)
bbmasks.append(mask)