summaryrefslogtreecommitdiffstats
path: root/meta/classes/image.bbclass
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-04-12 11:44:25 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-04-13 10:12:53 +0100
commit965fd3cf9a4aa448bae2c4984667dafb192808ea (patch)
tree01eaae888b5db2a3e4f4e657f2614d520e81cb0a /meta/classes/image.bbclass
parent6d85874180dc51005ee74a15465e907fddd9fac2 (diff)
downloadpoky-965fd3cf9a4aa448bae2c4984667dafb192808ea.tar.gz
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>
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r--meta/classes/image.bbclass4
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):
455 d.getVar('IMAGE_ROOTFS', True)]) 455 d.getVar('IMAGE_ROOTFS', True)])
456 size_kb = int(output.split()[0]) 456 size_kb = int(output.split()[0])
457 base_size = size_kb * overhead_factor 457 base_size = size_kb * overhead_factor
458 base_size = (base_size, rootfs_req_size)[base_size < rootfs_req_size] + \ 458 base_size = max(base_size, rootfs_req_size) + rootfs_extra_space
459 rootfs_extra_space
460 459
461 if base_size != int(base_size): 460 if base_size != int(base_size):
462 base_size = int(base_size + 1) 461 base_size = int(base_size + 1)
@@ -544,4 +543,3 @@ do_bundle_initramfs () {
544 : 543 :
545} 544}
546addtask bundle_initramfs after do_image_complete 545addtask bundle_initramfs after do_image_complete
547