From ce867a65b53f3082e3aa4f39e5b280aca8f2b4d7 Mon Sep 17 00:00:00 2001 From: Po Hu Date: Mon, 27 Nov 2023 14:16:44 +0800 Subject: [PATCH] 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 --- tools/releasetools/check_target_files_vintf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/releasetools/check_target_files_vintf.py b/tools/releasetools/check_target_files_vintf.py index 33624f5085..d31f87e962 100755 --- a/tools/releasetools/check_target_files_vintf.py +++ b/tools/releasetools/check_target_files_vintf.py @@ -218,12 +218,12 @@ def PrepareApexDirectory(inp, dirmap): 2. invoke apexd_host with vendor APEXes. """ - apex_dir = os.path.join(inp, 'APEX') + apex_dir = common.MakeTempDir('APEX') # checkvintf needs /apex dirmap dirmap['/apex'] = apex_dir # 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 apex_host = os.path.join(OPTIONS.search_path, 'bin', 'apexd_host')