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
diff --git a/tools/releasetools/check_target_files_vintf.py b/tools/releasetools/check_target_files_vintf.py
index 33624f5..d31f87e 100755
--- a/tools/releasetools/check_target_files_vintf.py
+++ b/tools/releasetools/check_target_files_vintf.py
@@ -218,12 +218,12 @@
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')