Handle zip64 extra fields better

Test: check_target_files_signatures
Bug: 283033491
Change-Id: I7da89f8389c09cc99201cff342483c158bd7e9c1
This commit is contained in:
Kelvin Zhang
2023-06-17 09:18:15 -07:00
parent 38d0c373ac
commit 1e774245a4
3 changed files with 30 additions and 12 deletions

View File

@@ -633,14 +633,17 @@ def GetTargetFilesZipForPartialUpdates(input_file, ab_partitions):
return True
return False
postinstall_config = common.ReadFromInputFile(input_file, POSTINSTALL_CONFIG)
postinstall_config = [
line for line in postinstall_config.splitlines() if IsInPartialList(line)]
if postinstall_config:
postinstall_config = "\n".join(postinstall_config)
common.WriteToInputFile(input_file, POSTINSTALL_CONFIG, postinstall_config)
else:
os.unlink(os.path.join(input_file, POSTINSTALL_CONFIG))
if common.DoesInputFileContain(input_file, POSTINSTALL_CONFIG):
postinstall_config = common.ReadFromInputFile(
input_file, POSTINSTALL_CONFIG)
postinstall_config = [
line for line in postinstall_config.splitlines() if IsInPartialList(line)]
if postinstall_config:
postinstall_config = "\n".join(postinstall_config)
common.WriteToInputFile(
input_file, POSTINSTALL_CONFIG, postinstall_config)
else:
os.unlink(os.path.join(input_file, POSTINSTALL_CONFIG))
return input_file