]> code.ossystems Code Review - openembedded-core.git/commitdiff
archiver: Escape recipe name in regex
authorJoshua Watt <jpewhacker@gmail.com>
Fri, 4 Aug 2017 16:26:58 +0000 (17:26 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 29 Aug 2017 14:11:40 +0000 (15:11 +0100)
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>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
meta/classes/archiver.bbclass

index 3543ca9c588322224bea7a28b953b8ad41cfa802..188f8c0423256275c16257e48976439d237d3f2a 100644 (file)
@@ -349,8 +349,8 @@ python do_ar_recipe () {
     bbappend_files = d.getVar('BBINCLUDED', True).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)