Remove APEX from merged target-files package

It was a temp folder created for check_target_files_vintf.py.
But now it is wrongly archived by create_target_files_archive
in merge_target_files.py.
And then such package will cause CheckVintf exception in
ota_from_target_files.py because the APEX folder is created
again but already exists.
So use MakeTempDir to make it removed after check finished.

Test: merge_target_files & ota_from_target_files
Change-Id: Iab54afff2c346a582d5ee5228103fe091e016cd0
This commit is contained in:
Po Hu
2023-11-27 14:16:44 +08:00
parent 53084d3f91
commit ce867a65b5

View File

@@ -218,12 +218,12 @@ def PrepareApexDirectory(inp, dirmap):
2. invoke apexd_host with vendor APEXes. 2. invoke apexd_host with vendor APEXes.
""" """
apex_dir = os.path.join(inp, 'APEX') apex_dir = common.MakeTempDir('APEX')
# checkvintf needs /apex dirmap # checkvintf needs /apex dirmap
dirmap['/apex'] = apex_dir dirmap['/apex'] = apex_dir
# Always create /apex directory for dirmap # Always create /apex directory for dirmap
os.makedirs(apex_dir) os.makedirs(apex_dir, exist_ok=True)
# Invoke apexd_host to activate vendor APEXes for checkvintf # Invoke apexd_host to activate vendor APEXes for checkvintf
apex_host = os.path.join(OPTIONS.search_path, 'bin', 'apexd_host') apex_host = os.path.join(OPTIONS.search_path, 'bin', 'apexd_host')