aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMariano Lopez <mariano.lopez@linux.intel.com>2016-03-22 14:04:00 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-24 21:44:27 +0000
commite3239ade430ff48e00dce47066abe8fcb990af61 (patch)
tree7c44744de6ad00ca6779e4803461ba5617389374
parent6c76c9e5bb4f4bf6adfac7ccece03d7dcdea7f3d (diff)
downloadopenembedded-core-contrib-e3239ade430ff48e00dce47066abe8fcb990af61.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. Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
-rw-r--r--meta/classes/archiver.bbclass15
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 () {
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"