summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-06-14 12:07:04 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-14 14:44:59 +0100
commitd24dd95f2c1c7f773875454bee3f2016c4e7553c (patch)
tree4cc8a42d06dff274596d64d4e27c32d589b12998
parentf2d349887710dcae05db09dc2277223e85fa1c19 (diff)
downloadopenembedded-core-contrib-d24dd95f2c1c7f773875454bee3f2016c4e7553c.tar.gz
openembedded-core-contrib-d24dd95f2c1c7f773875454bee3f2016c4e7553c.tar.bz2
openembedded-core-contrib-d24dd95f2c1c7f773875454bee3f2016c4e7553c.zip
image.bbclass: cleanup: add new variable "task"
Replaced repeated expression "do_image_%s" % t with a variable 'task' to simplify the code and increase readability. Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/image.bbclass26
1 files changed, 13 insertions, 13 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index 85f6b9a87b..ff4eda19e9 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -491,19 +491,19 @@ python () {
for dep in typedeps[t]:
after += ' do_image_%s' % dep.replace("-", "_").replace(".", "_")
- t = t.replace("-", "_").replace(".", "_")
-
- d.setVar('do_image_%s' % t, '\n'.join(cmds))
- d.setVarFlag('do_image_%s' % t, 'func', '1')
- d.setVarFlag('do_image_%s' % t, 'fakeroot', '1')
- d.setVarFlag('do_image_%s' % t, 'prefuncs', debug + 'set_image_size')
- d.setVarFlag('do_image_%s' % t, 'postfuncs', 'create_symlinks')
- d.setVarFlag('do_image_%s' % t, 'subimages', ' '.join(subimages))
- d.appendVarFlag('do_image_%s' % t, 'vardeps', ' '.join(vardeps))
- d.appendVarFlag('do_image_%s' % t, 'vardepsexclude', 'DATETIME')
-
- bb.debug(2, "Adding type %s before %s, after %s" % (t, 'do_image_complete', after))
- bb.build.addtask('do_image_%s' % t, 'do_image_complete', after, d)
+ task = "do_image_%s" % t.replace("-", "_").replace(".", "_")
+
+ d.setVar(task, '\n'.join(cmds))
+ d.setVarFlag(task, 'func', '1')
+ d.setVarFlag(task, 'fakeroot', '1')
+ d.setVarFlag(task, 'prefuncs', debug + 'set_image_size')
+ d.setVarFlag(task, 'postfuncs', 'create_symlinks')
+ d.setVarFlag(task, 'subimages', ' '.join(subimages))
+ d.appendVarFlag(task, 'vardeps', ' '.join(vardeps))
+ d.appendVarFlag(task, 'vardepsexclude', 'DATETIME')
+
+ bb.debug(2, "Adding task %s before %s, after %s" % (task, 'do_image_complete', after))
+ bb.build.addtask(task, 'do_image_complete', after, d)
}
#