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 17:17:01 +0000 |
| commit | 7843548285e2eea8158670316058fff4b769c236 (patch) | |
| tree | 1abc8618037b3e34b1a0fe93f8a38b93e5e1c0f4 /meta/classes/license_image.bbclass | |
| parent | 0985ac745f978396086417a25c1271e28ec65b2d (diff) | |
| download | poky-7843548285e2eea8158670316058fff4b769c236.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.
(From OE-Core rev: 252b69c9f2abe3258366c540f56b156ed63e5437)
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): | |||
| 52 | except oe.license.LicenseError as exc: | 52 | except oe.license.LicenseError as exc: |
| 53 | bb.fatal('%s: %s' % (d.getVar('P'), exc)) | 53 | bb.fatal('%s: %s' % (d.getVar('P'), exc)) |
| 54 | else: | 54 | else: |
| 55 | pkg_dic[pkg]["LICENSES"] = re.sub('[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) | 55 | pkg_dic[pkg]["LICENSES"] = re.sub(r'[|&()*]', ' ', pkg_dic[pkg]["LICENSE"]) |
| 56 | pkg_dic[pkg]["LICENSES"] = re.sub(' *', ' ', pkg_dic[pkg]["LICENSES"]) | 56 | pkg_dic[pkg]["LICENSES"] = re.sub(r' *', ' ', pkg_dic[pkg]["LICENSES"]) |
| 57 | pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() | 57 | pkg_dic[pkg]["LICENSES"] = pkg_dic[pkg]["LICENSES"].split() |
| 58 | 58 | ||
| 59 | if not "IMAGE_MANIFEST" in pkg_dic[pkg]: | 59 | if not "IMAGE_MANIFEST" in pkg_dic[pkg]: |
| @@ -78,7 +78,7 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 78 | for lic in pkg_dic[pkg]["LICENSES"]: | 78 | for lic in pkg_dic[pkg]["LICENSES"]: |
| 79 | lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'), | 79 | lic_file = os.path.join(d.getVar('LICENSE_DIRECTORY'), |
| 80 | pkg_dic[pkg]["PN"], "generic_%s" % | 80 | pkg_dic[pkg]["PN"], "generic_%s" % |
| 81 | re.sub('\+', '', lic)) | 81 | re.sub(r'\+', '', lic)) |
| 82 | # add explicity avoid of CLOSED license because isn't generic | 82 | # add explicity avoid of CLOSED license because isn't generic |
| 83 | if lic == "CLOSED": | 83 | if lic == "CLOSED": |
| 84 | continue | 84 | continue |
| @@ -119,14 +119,14 @@ def write_license_files(d, license_manifest, pkg_dic, rootfs=True): | |||
| 119 | pkg_license = os.path.join(pkg_license_dir, lic) | 119 | pkg_license = os.path.join(pkg_license_dir, lic) |
| 120 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) | 120 | pkg_rootfs_license = os.path.join(pkg_rootfs_license_dir, lic) |
| 121 | 121 | ||
| 122 | if re.match("^generic_.*$", lic): | 122 | if re.match(r"^generic_.*$", lic): |
| 123 | generic_lic = canonical_license(d, | 123 | generic_lic = canonical_license(d, |
| 124 | re.search("^generic_(.*)$", lic).group(1)) | 124 | re.search(r"^generic_(.*)$", lic).group(1)) |
| 125 | 125 | ||
| 126 | # Do not copy generic license into package if isn't | 126 | # Do not copy generic license into package if isn't |
| 127 | # declared into LICENSES of the package. | 127 | # declared into LICENSES of the package. |
| 128 | if not re.sub('\+$', '', generic_lic) in \ | 128 | if not re.sub(r'\+$', '', generic_lic) in \ |
| 129 | [re.sub('\+', '', lic) for lic in \ | 129 | [re.sub(r'\+', '', lic) for lic in \ |
| 130 | pkg_manifest_licenses]: | 130 | pkg_manifest_licenses]: |
| 131 | continue | 131 | continue |
| 132 | 132 | ||
