diff --git a/vndk/tools/header-checker/utils/utils.py b/vndk/tools/header-checker/utils/utils.py index 5f956bf96..521355622 100644 --- a/vndk/tools/header-checker/utils/utils.py +++ b/vndk/tools/header-checker/utils/utils.py @@ -251,9 +251,11 @@ def _read_lsdump_paths(lsdump_paths_file_path, vndk_version, targets): def read_lsdump_paths(product, variant, vndk_version, targets, build=True): """Build lsdump_paths.txt and read the paths.""" lsdump_paths_file_path = get_lsdump_paths_file_path(product, variant) - if build: - make_targets(product, variant, [lsdump_paths_file_path]) lsdump_paths_file_abspath = os.path.join(AOSP_DIR, lsdump_paths_file_path) + if build: + if os.path.lexists(lsdump_paths_file_abspath): + os.unlink(lsdump_paths_file_abspath) + make_targets(product, variant, [lsdump_paths_file_path]) return _read_lsdump_paths(lsdump_paths_file_abspath, vndk_version, targets)