Merge "Open ab_partitions.txt with just read access" am: f9a6f5f06b am: b5535214ad

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

Change-Id: I5f78de5ef067ee26644a82381fc85c5f81b73e03
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot 2023-06-01 23:28:18 +00:00 committed by Automerger Merge Worker
commit 4cd34e5ce6

View file

@ -817,8 +817,8 @@ class PayloadGenerator(object):
target_dir = ExtractTargetFiles(target_file)
cmd = ["delta_generator",
"--out_file", payload_file]
with open(os.path.join(target_dir, "META", "ab_partitions.txt")) as fp:
ab_partitions = fp.read().strip().split("\n")
with open(os.path.join(target_dir, "META", "ab_partitions.txt"), "r") as fp:
ab_partitions = fp.read().strip().splitlines()
cmd.extend(["--partition_names", ":".join(ab_partitions)])
cmd.extend(
["--new_partitions", GetPartitionImages(target_dir, ab_partitions, False)])