Returns empty apex_infos if the apex target dir does not exist.

This is needed for partial builds that do not have the apex directory in
their target files package.

Test: build target files for a partial vendor-only build.
Change-Id: I076bfbd1a81cccddcef795f5edeaf2b51538cdec
This commit is contained in:
Daniel Norman
2021-02-17 13:22:21 -08:00
parent 43d4040f6f
commit b4b07aba7d
3 changed files with 11 additions and 6 deletions

View File

@@ -516,7 +516,7 @@ def SignApex(avbtool, apex_data, payload_key, container_key, container_pw,
raise ApexInfoError(
'Failed to get type for {}:\n{}'.format(apex_file, e))
def GetApexInfoFromTargetFiles(input_file):
def GetSystemApexInfoFromTargetFiles(input_file):
"""
Get information about system APEX stored in the input_file zip
@@ -538,6 +538,11 @@ def GetApexInfoFromTargetFiles(input_file):
tmp_dir = UnzipTemp(input_file, ["SYSTEM/apex/*"])
target_dir = os.path.join(tmp_dir, "SYSTEM/apex/")
# Partial target-files packages for vendor-only builds may not contain
# a system apex directory.
if not os.path.exists(target_dir):
return []
apex_infos = []
debugfs_path = "debugfs"