diff options
| author | Anton Eliasson <anton.eliasson@axis.com> | 2020-05-08 16:07:04 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-05-12 15:20:42 +0100 |
| commit | fbb08a1561a6cc21bd01b78a101552fb9ff936c8 (patch) | |
| tree | 98b856e2b6c2e7dceae18489b8fd22d17bec5253 /meta | |
| parent | cfa1424b3c9f858bde0be2603b9c19aecbb56ceb (diff) | |
| download | poky-fbb08a1561a6cc21bd01b78a101552fb9ff936c8.tar.gz | |
meson.bbclass: Close the log file after reading
This fixes warnings like:
WARNING: package-name-0.0.1-r0 do_configure: <string>:164: ResourceWarning:
unclosed file <_io.TextIOWrapper
name='/source_directory/build/tmp/work/arch/package-name/0.0.1-r0/package-name-0.0.1//meson-logs/meson-log.txt'
mode='r' encoding='UTF-8'>
(From OE-Core rev: 4fe8bb4e3f15a3f4e153605d57096c565c5fac21)
Signed-off-by: Anton Eliasson <anton.eliasson@axis.com>
Reviewed-by: Ola x Nilsson <ola.x.nilsson@axis.com>
Signed-off-by: Anton Eliasson <anton.eliasson@axis.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
| -rw-r--r-- | meta/classes/meson.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/meson.bbclass b/meta/classes/meson.bbclass index 06034e8b47..e9628033c6 100644 --- a/meta/classes/meson.bbclass +++ b/meta/classes/meson.bbclass | |||
| @@ -164,7 +164,8 @@ meson_do_configure_prepend_class-native() { | |||
| 164 | python meson_do_qa_configure() { | 164 | python meson_do_qa_configure() { |
| 165 | import re | 165 | import re |
| 166 | warn_re = re.compile(r"^WARNING: Cross property (.+) is using default value (.+)$", re.MULTILINE) | 166 | warn_re = re.compile(r"^WARNING: Cross property (.+) is using default value (.+)$", re.MULTILINE) |
| 167 | log = open(d.expand("${B}/meson-logs/meson-log.txt")).read() | 167 | with open(d.expand("${B}/meson-logs/meson-log.txt")) as logfile: |
| 168 | log = logfile.read() | ||
| 168 | for (prop, value) in warn_re.findall(log): | 169 | for (prop, value) in warn_re.findall(log): |
| 169 | bb.warn("Meson cross property %s used without explicit assignment, defaulting to %s" % (prop, value)) | 170 | bb.warn("Meson cross property %s used without explicit assignment, defaulting to %s" % (prop, value)) |
| 170 | } | 171 | } |
