From bb12587e0ba83ed6cde0f395c0a31cee9a3ace26 Mon Sep 17 00:00:00 2001 From: Tristan Partin Date: Mon, 26 Apr 2021 10:14:39 -0500 Subject: Add subprojects purge wrap-git coverage --- mesonbuild/msubprojects.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'mesonbuild/msubprojects.py') diff --git a/mesonbuild/msubprojects.py b/mesonbuild/msubprojects.py index bdd8c1f..b50c986 100755 --- a/mesonbuild/msubprojects.py +++ b/mesonbuild/msubprojects.py @@ -325,11 +325,14 @@ def purge(r: Resolver, wrap: PackageDefinition, repo_dir: str, options: argparse if options.include_cache: packagecache = Path(r.cachedir).resolve() - subproject_cache_file = packagecache / wrap.get("source_filename") - if subproject_cache_file.is_file(): - if options.confirm: - subproject_cache_file.unlink() - mlog.log(f'Deleting {subproject_cache_file}') + try: + subproject_cache_file = packagecache / wrap.get("source_filename") + if subproject_cache_file.is_file(): + if options.confirm: + subproject_cache_file.unlink() + mlog.log(f'Deleting {subproject_cache_file}') + except WrapException: + pass try: subproject_patch_file = packagecache / wrap.get("patch_filename") @@ -353,7 +356,6 @@ def purge(r: Resolver, wrap: PackageDefinition, repo_dir: str, options: argparse subproject_source_dir.unlink() mlog.log(f'Deleting {subproject_source_dir}') return True - if not subproject_source_dir.is_dir(): return True -- cgit v1.1