diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-07 00:04:50 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-06 16:38:30 +0000 |
commit | 5ab73d1747175434e3b784fa75ac28979d2fe2f9 (patch) | |
tree | 0664fa3199f09547bc154481a78d571f886e651b /meta/classes/license_image.bbclass | |
parent | 91c93503fde2781792507b321e40552be4d78b9b (diff) | |
download | poky-5ab73d1747175434e3b784fa75ac28979d2fe2f9.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)
(From OE-Core rev: 778f33d40c7e2f4174cc99d25516e5db63d6f75b)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
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 f0fbb763f1..b65ff56f7d 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): | |||
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): | |||
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): | |||
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 | ||