]> code.ossystems Code Review - openembedded-core.git/commitdiff
archiver: Escape recipe name in regex
authorJoshua Watt <jpewhacker@gmail.com>
Wed, 31 May 2017 12:42:37 +0000 (07:42 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 3 Jun 2017 22:43:27 +0000 (23:43 +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>
meta/classes/archiver.bbclass

index aa741463d7ae1527d63b4403dbfb80f07497ffd8..37a21fe61bc8da21bd7f42b96431292b8e629d0e 100644 (file)
@@ -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)