diff options
author | Mariano Lopez <mariano.lopez@linux.intel.com> | 2016-03-22 14:04:00 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-25 10:29:17 +0000 |
commit | 8b7ee6ebebf765e5b4afea4d9846926a75e95f01 (patch) | |
tree | 755dd4cd5759444c05a9f534f0369c10a7d12cd7 /meta/classes/archiver.bbclass | |
parent | bc100b33ef0752af7f4c0fdf8fdeeb8417a5320c (diff) | |
download | poky-8b7ee6ebebf765e5b4afea4d9846926a75e95f01.tar.gz |
archiver.bbclass: Don't expand python functions in dumpdata
Currently the dumpdata task expands python data in the datastore, in
some functions this causes a silent error and the task will fail.
The change also rewrite the function to make a bit clearer.
(From OE-Core rev: e3239ade430ff48e00dce47066abe8fcb990af61)
Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r-- | meta/classes/archiver.bbclass | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index b95176bb9a..221c7f4797 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass | |||
@@ -335,14 +335,13 @@ python do_dumpdata () { | |||
335 | dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR', True), \ | 335 | dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR', True), \ |
336 | '%s-showdata.dump' % d.getVar('PF', True)) | 336 | '%s-showdata.dump' % d.getVar('PF', True)) |
337 | bb.note('Dumping metadata into %s' % dumpfile) | 337 | bb.note('Dumping metadata into %s' % dumpfile) |
338 | f = open(dumpfile, 'w') | 338 | with open(dumpfile, "w") as f: |
339 | # emit variables and shell functions | 339 | # emit variables and shell functions |
340 | bb.data.emit_env(f, d, True) | 340 | bb.data.emit_env(f, d, True) |
341 | # emit the metadata which isn't valid shell | 341 | # emit the metadata which isn't valid shell |
342 | for e in d.keys(): | 342 | for e in d.keys(): |
343 | if bb.data.getVarFlag(e, 'python', d): | 343 | if d.getVarFlag(e, "python", False): |
344 | f.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, True))) | 344 | f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, False))) |
345 | f.close() | ||
346 | } | 345 | } |
347 | 346 | ||
348 | SSTATETASKS += "do_deploy_archives" | 347 | SSTATETASKS += "do_deploy_archives" |