aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/cookerdata.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2016-04-30 12:52:49 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-19 09:05:21 +0100
commit32ee30a46d5e27ffcb0f18d85a0768bd22adca94 (patch)
tree711b1253359d62d29586ae8b362eac4e7ef7f859 /bitbake/lib/bb/cookerdata.py
parent90bc9b4f3342c41e4f9c20a6f0f8e69b8ed4bce3 (diff)
downloadopenembedded-core-contrib-32ee30a46d5e27ffcb0f18d85a0768bd22adca94.tar.gz
bitbake: Provide LAYERDIR_RE for layer.conf
This variable is a regex-escaped version of LAYERDIR, for safer use in BBFILE_PATTERN, so as to avoid issues with regex special characters in the layer path. [YOCTO #8402] (Bitbake rev: 72900522778b6ff08b135bf8bb97dff3f1a20bd9) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/cookerdata.py')
-rw-r--r--bitbake/lib/bb/cookerdata.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index fba95afa54..1615db5b17 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -22,9 +22,11 @@
# with this program; if not, write to the Free Software Foundation, Inc.,
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-import os, sys
-from functools import wraps
import logging
+import os
+import re
+import sys
+from functools import wraps
import bb
from bb import data
import bb.parse
@@ -296,9 +298,12 @@ class CookerDataBuilder(object):
if layer.endswith('/'):
layer = layer.rstrip('/')
data.setVar('LAYERDIR', layer)
+ data.setVar('LAYERDIR_RE', re.escape(layer))
data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data)
data.expandVarref('LAYERDIR')
+ data.expandVarref('LAYERDIR_RE')
+ data.delVar('LAYERDIR_RE')
data.delVar('LAYERDIR')
if not data.getVar("BBPATH", True):