From faf523911a595ad672f21c370d609e2212e79ebb Mon Sep 17 00:00:00 2001 From: Minecrell Date: Wed, 13 Apr 2022 20:40:06 +0200 Subject: [PATCH] pmb.install: Treat empty "flash_sparse_samsung_format" as disabled (MR 2180) Deviceinfo variables are empty strings by default if they are unset in the deviceinfo file, so the "is not None" check currently enables the sm_sparse_image_tool for all existing devices using sparse format. Simplify the check to convert the string to a bool. Empty strings evaluate to False so this should work as originally intended. --- pmb/install/_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pmb/install/_install.py b/pmb/install/_install.py index 6436a79f..ef36a23b 100644 --- a/pmb/install/_install.py +++ b/pmb/install/_install.py @@ -716,7 +716,7 @@ def install_system_image(args, size_reserve, suffix, step, steps, # patch sparse image for Samsung devices if specified samsungify_strategy = args.deviceinfo["flash_sparse_samsung_format"] - if samsungify_strategy is not None: + if samsungify_strategy: logging.info("(native) convert sparse image into Samsung's sparse image format") pmb.chroot.apk.install(args, ["sm-sparse-image-tool"]) sys_image = f"{args.device}.img"