aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Watt <jpewhacker@gmail.com>2017-05-31 07:42:37 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-03 23:43:27 +0100
commit53c8cceb744adda1bf899d62071d11b20a5dea98 (patch)
tree0a800680cd397f04b97abe32085402147480d4d4
parenteeb248c1a017e07e36b6fbaafe45006e3869f41a (diff)
downloadopenembedded-core-53c8cceb744adda1bf899d62071d11b20a5dea98.zip
openembedded-core-53c8cceb744adda1bf899d62071d11b20a5dea98.tar.gz
openembedded-core-53c8cceb744adda1bf899d62071d11b20a5dea98.tar.bz2
archiver: Escape recipe name in regex
The recipe name needs to be escaped when using it in a regular expression so that and special characters are treated literally Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/archiver.bbclass4
1 files changed, 2 insertions, 2 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index aa74146..37a21fe 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -378,8 +378,8 @@ python do_ar_recipe () {
bbappend_files = d.getVar('BBINCLUDED').split()
# If recipe name is aa, we need to match files like aa.bbappend and aa_1.1.bbappend
# Files like aa1.bbappend or aa1_1.1.bbappend must be excluded.
- bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" %pn)
- bbappend_re1 = re.compile( r".*/%s\.bbappend$" %pn)
+ bbappend_re = re.compile( r".*/%s_[^/]*\.bbappend$" % re.escape(pn))
+ bbappend_re1 = re.compile( r".*/%s\.bbappend$" % re.escape(pn))
for file in bbappend_files:
if bbappend_re.match(file) or bbappend_re1.match(file):
shutil.copy(file, outdir)