diff options
author | Ross Burton <ross.burton@intel.com> | 2016-04-12 11:44:25 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-04-13 10:12:44 +0100 |
commit | 7ee49f8a41b4b5c48fd283ac2768564c7ebb5332 (patch) | |
tree | b70536f5089e844eb72b437e3f5f28c8d689ab7c /meta/classes/image.bbclass | |
parent | 04556b33d5bf232ed4de14725cf94627f434131e (diff) | |
download | openembedded-core-7ee49f8a41b4b5c48fd283ac2768564c7ebb5332.tar.gz openembedded-core-7ee49f8a41b4b5c48fd283ac2768564c7ebb5332.tar.bz2 openembedded-core-7ee49f8a41b4b5c48fd283ac2768564c7ebb5332.zip |
image.bbclass: use max() instead of indexing booleans
There's some code dotted around OE that uses (a, b)[foo < bar] instead of the
more idiomatic "test and a or b". Or in this case, just max().
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index ea77ab8878..039feec792 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -455,8 +455,7 @@ def get_rootfs_size(d): d.getVar('IMAGE_ROOTFS', True)]) size_kb = int(output.split()[0]) base_size = size_kb * overhead_factor - base_size = (base_size, rootfs_req_size)[base_size < rootfs_req_size] + \ - rootfs_extra_space + base_size = max(base_size, rootfs_req_size) + rootfs_extra_space if base_size != int(base_size): base_size = int(base_size + 1) @@ -544,4 +543,3 @@ do_bundle_initramfs () { : } addtask bundle_initramfs after do_image_complete - |