diff options
author | Christopher Larson <chris_larson@mentor.com> | 2016-04-30 12:52:49 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-19 09:05:21 +0100 |
commit | 32ee30a46d5e27ffcb0f18d85a0768bd22adca94 (patch) | |
tree | 711b1253359d62d29586ae8b362eac4e7ef7f859 /bitbake/lib | |
parent | 90bc9b4f3342c41e4f9c20a6f0f8e69b8ed4bce3 (diff) | |
download | poky-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')
-rw-r--r-- | bitbake/lib/bb/cookerdata.py | 9 |
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 @@ | |||
22 | # with this program; if not, write to the Free Software Foundation, Inc., | 22 | # with this program; if not, write to the Free Software Foundation, Inc., |
23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 23 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
24 | 24 | ||
25 | import os, sys | ||
26 | from functools import wraps | ||
27 | import logging | 25 | import logging |
26 | import os | ||
27 | import re | ||
28 | import sys | ||
29 | from functools import wraps | ||
28 | import bb | 30 | import bb |
29 | from bb import data | 31 | from bb import data |
30 | import bb.parse | 32 | import bb.parse |
@@ -296,9 +298,12 @@ class CookerDataBuilder(object): | |||
296 | if layer.endswith('/'): | 298 | if layer.endswith('/'): |
297 | layer = layer.rstrip('/') | 299 | layer = layer.rstrip('/') |
298 | data.setVar('LAYERDIR', layer) | 300 | data.setVar('LAYERDIR', layer) |
301 | data.setVar('LAYERDIR_RE', re.escape(layer)) | ||
299 | data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data) | 302 | data = parse_config_file(os.path.join(layer, "conf", "layer.conf"), data) |
300 | data.expandVarref('LAYERDIR') | 303 | data.expandVarref('LAYERDIR') |
304 | data.expandVarref('LAYERDIR_RE') | ||
301 | 305 | ||
306 | data.delVar('LAYERDIR_RE') | ||
302 | data.delVar('LAYERDIR') | 307 | data.delVar('LAYERDIR') |
303 | 308 | ||
304 | if not data.getVar("BBPATH", True): | 309 | if not data.getVar("BBPATH", True): |