From: Andre McCurdy Date: Wed, 1 Feb 2017 21:09:16 +0000 (-0800) Subject: bitbake: cooker: detect malformed BBMASK expressions which begin with a separator X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7ab8b6558c568399769cfbad4e480981558768d9;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: 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_. (Bitbake rev: 56ad67017e601c7e0f6085ca84e29c28d8d4519f) Signed-off-by: Andre McCurdy Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index ce84e1c7459..662a7ac0718 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/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)