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>
This commit is contained in:
Mariano Lopez 2016-03-22 14:04:00 +00:00 committed by Richard Purdie
parent bc100b33ef
commit 8b7ee6ebeb
1 changed files with 7 additions and 8 deletions

View File

@ -335,14 +335,13 @@ python do_dumpdata () {
dumpfile = os.path.join(d.getVar('ARCHIVER_OUTDIR', True), \
'%s-showdata.dump' % d.getVar('PF', True))
bb.note('Dumping metadata into %s' % dumpfile)
f = open(dumpfile, 'w')
# emit variables and shell functions
bb.data.emit_env(f, d, True)
# emit the metadata which isn't valid shell
for e in d.keys():
if bb.data.getVarFlag(e, 'python', d):
f.write("\npython %s () {\n%s}\n" % (e, bb.data.getVar(e, d, True)))
f.close()
with open(dumpfile, "w") as f:
# emit variables and shell functions
bb.data.emit_env(f, d, True)
# emit the metadata which isn't valid shell
for e in d.keys():
if d.getVarFlag(e, "python", False):
f.write("\npython %s () {\n%s}\n" % (e, d.getVar(e, False)))
}
SSTATETASKS += "do_deploy_archives"