1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-03 01:40:07 +00:00

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().

(From OE-Core rev: 7ee49f8a41b4b5c48fd283ac2768564c7ebb5332)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ross Burton
2016-04-12 11:44:25 +01:00
committed by Richard Purdie
parent 6d85874180
commit 965fd3cf9a
+1 -3
View File
@@ -455,8 +455,7 @@ def get_rootfs_size(d):
d.getVar('IMAGE_ROOTFS', True)]) d.getVar('IMAGE_ROOTFS', True)])
size_kb = int(output.split()[0]) size_kb = int(output.split()[0])
base_size = size_kb * overhead_factor base_size = size_kb * overhead_factor
base_size = (base_size, rootfs_req_size)[base_size < rootfs_req_size] + \ base_size = max(base_size, rootfs_req_size) + rootfs_extra_space
rootfs_extra_space
if base_size != int(base_size): if base_size != int(base_size):
base_size = int(base_size + 1) base_size = int(base_size + 1)
@@ -544,4 +543,3 @@ do_bundle_initramfs () {
: :
} }
addtask bundle_initramfs after do_image_complete addtask bundle_initramfs after do_image_complete