cooker: detect malformed BBMASK expressions which begin with a separator
PATCH 1/1 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 <[email protected]>
--- lib/bb/cooker.py | 5 +++++ 1 file changed, 5 insertions(+)
lib/bb/cooker.py +5 -0
@@ -1867,6 +1867,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)
Signature · 1 line
1.9.1
Quoted 2 lines · Andre McCurdy
When constructing an older style single regex, it's possible for BBMASK to end up beginning with '|', which matches and masks _everything_.
Ping.
Quoted 24 lines
Signed-off-by Andre McCurdy <[email protected]>--- lib/bb/cooker.py | 5 +++++ 1 file changed, 5 insertions(+)lib/bb/cooker.py +5
-1@@ -1867,6 +1867,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) --1.9.1