Fix incremental OTA generation failures

source_file might be a directory, use the _ReadApexInfo() helper
function to read it instead of go straight to zipfiles.

Test: build incremental OTA for pixel
Bug: 279142680
Bug: 227848550
Bug: 277028723

Change-Id: Ia0041e2c72c1a57123519c970f6e734194a81cd2
This commit is contained in:
Kelvin Zhang
2023-04-21 09:46:47 -07:00
parent fad3925959
commit ca45d7a85d

View File

@@ -642,8 +642,7 @@ def ConstructOtaApexInfo(target_zip, source_file=None):
if not source_file:
return target_apex_string
with zipfile.ZipFile(source_file, "r", allowZip64=True) as source_zip:
source_apex_string = _ReadApexInfo(source_zip)
source_apex_string = _ReadApexInfo(source_file)
if not source_apex_string:
return target_apex_string