diff options
authorDengke Du <dengke.du@windriver.com>2016-12-02 16:08:57 +0800
committerDengke Du <dengke.du@windriver.com>2016-12-05 14:34:27 +0800
commitcef1e506813912154f9fddeedcdf332e732751bf (patch)
parent0b5f26f5b17cda3f6b18b6ee54c35eac03642bdf (diff)
archiver.bbclass: fix do_ar_recipe error for bonnie++ and libsigc++-2.0ddk/fix-some-error-for-archiver-bbclass
When recipes name contains regular expression special characters, such as "++", in this case, the re.compile function in do_ar_recipe can't recognize it, so we should associate with re.escape to recognize the special characters in pattern. Signed-off-by: Dengke Du <dengke.du@windriver.com>
1 files changed, 3 insertions, 2 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index fe8877bc75..7d89e449d3 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -359,8 +359,9 @@ 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)
+ # If the "pn" contains regular expression special characters, we should use re.escape to recognize it.
+ 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)