Merge "Only enable zucchini if configuration file exists" am: 7b53ae67f1

Original change: https://android-review.googlesource.com/c/platform/build/+/2085423

Change-Id: I02323ad00549c82fa8818e05f6dad47a1664fe53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-05-04 03:20:08 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 3 deletions

View File

@@ -1208,6 +1208,8 @@ def GenerateAbOtaPackage(target_file, output_file, source_file=None):
metadata.postcondition.partition_state) metadata.postcondition.partition_state)
if not ota_utils.IsZucchiniCompatible(source_file, target_file): if not ota_utils.IsZucchiniCompatible(source_file, target_file):
logger.warning(
"Builds doesn't support zucchini, or source/target don't have compatible zucchini versions. Disabling zucchini.")
OPTIONS.enable_zucchini = False OPTIONS.enable_zucchini = False
additional_args += ["--enable_zucchini", additional_args += ["--enable_zucchini",

View File

@@ -697,6 +697,7 @@ def IsZucchiniCompatible(source_file: str, target_file: str):
if os.path.exists(entry_path): if os.path.exists(entry_path):
with open(entry_path, "r") as fp: with open(entry_path, "r") as fp:
return fp.read() return fp.read()
else: return False
return "" sourceEntry = ReadEntry(source_file, _ZUCCHINI_CONFIG_ENTRY_NAME)
return ReadEntry(source_file, _ZUCCHINI_CONFIG_ENTRY_NAME) == ReadEntry(target_file, _ZUCCHINI_CONFIG_ENTRY_NAME) targetEntry = ReadEntry(target_file, _ZUCCHINI_CONFIG_ENTRY_NAME)
return sourceEntry and targetEntry and sourceEntry == targetEntry