From b67b0d5bc083f39b2c83bd58f992d10ce3cdf1ea Mon Sep 17 00:00:00 2001 From: jiangxu5 Date: Fri, 3 Jun 2022 14:46:56 +0800 Subject: [PATCH] [Bugfix] Check for presence before ZipWrite There are vendor products but no *.map situation Signed-off-by: jiangxu5 Change-Id: I93a710fd10870b7406b1d7beb5a6f51b6badc104 --- tools/releasetools/sign_target_files_apks.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/releasetools/sign_target_files_apks.py b/tools/releasetools/sign_target_files_apks.py index 78fc8866bf..27e9dfbed6 100755 --- a/tools/releasetools/sign_target_files_apks.py +++ b/tools/releasetools/sign_target_files_apks.py @@ -1355,7 +1355,8 @@ def BuildVendorPartitions(output_zip_path): img_file_path = "IMAGES/{}.img".format(p) map_file_path = "IMAGES/{}.map".format(p) common.ZipWrite(output_zip, os.path.join(vendor_tempdir, img_file_path), img_file_path) - common.ZipWrite(output_zip, os.path.join(vendor_tempdir, map_file_path), map_file_path) + if os.path.exists(os.path.join(vendor_tempdir, map_file_path)): + common.ZipWrite(output_zip, os.path.join(vendor_tempdir, map_file_path), map_file_path) # copy recovery.img, boot.img, recovery patch & install.sh if OPTIONS.rebuild_recovery: recovery_img = "IMAGES/recovery.img"