diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-07 00:04:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-08 00:12:34 +0000 |
commit | 252b69c9f2abe3258366c540f56b156ed63e5437 (patch) | |
tree | 16cc36df6a0b7226a60bd0b3ce42e3177b762605 /meta/classes/license_image.bbclass | |
parent | 48719bc4d108df7e357e7f22f9f356cd72b3ebbd (diff) | |
download | openembedded-core-252b69c9f2abe3258366c540f56b156ed63e5437.tar.gz |
classes: Correctly markup regex strings
There are various escape characters in these stings which python warns
about so use the correct regex markup for them.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/license_image.bbclass')
-rw-r--r-- | meta/classes/license_image.bbclass | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/meta/classes/license_image.bbclass b/meta/classes/license_image.bbclass index 6515ee8278..6ac63e0192 100644 --- a/meta/classes/license_image.bbclass +++ b/meta/classes/license_image.bbclass @@ -52,8 +52,8 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): except oe.license.LicenseError as exc: bb.fatal('%s: %s' % (d.getVar('P'), exc)) else: - pkg_dic[pkg]["LICENSES"] = re.sub('[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) - pkg_dic[pkg]["LICENSES"] = re.sub(' *', ' ', pkg_dic[pkg]["LICENSES"]) + pkg_dic[pkg]["LICENSES"] = re.sub(r'[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) + pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() if not "IMAGE_MANIFEST" in pkg_dic[pkg]: @@ -78,7 +78,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): for lic in pkg_dic[pkg]["LICENSES"]: lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'), pkg_dic[pkg]["PN"], "generic_%s" % - re.sub('\+', '', lic)) + re.sub(r'\+', '', lic)) # add explicity avoid of CLOSED license because isn't generic if lic == "CLOSED": continue @@ -119,14 +119,14 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): pkg_license = os.path.join(pkg_license_dir, lic) pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) - if re.match("^generic_.*$", lic): + if re.match(r"^generic_.*$", lic): generic_lic = canonical_license(d, - re.search("^generic_(.*)$", lic).group(1)) + re.search(r"^generic_(.*)$", lic).group(1)) # Do not copy generic license into package if isn't # declared into LICENSES of the package. - if not re.sub('\+$', '', generic_lic) in \ - [re.sub('\+', '', lic) for lic in \ + if not re.sub(r'\+$', '', generic_lic) in \ + [re.sub(r'\+', '', lic) for lic in \ pkg_manifest_licenses]: continue |