From 9e59917ee07b4d9548f214013efe3d8f02ea4922 Mon Sep 17 00:00:00 2001 From: Adriano Scoditti Date: Wed, 26 Jun 2019 10:59:17 +0200 Subject: [PATCH] Do not clean lock files in top and run dirs if no-lock opts are set --- waflib/Scripting.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/waflib/Scripting.py b/waflib/Scripting.py index ae17a8b4..68dccf29 100644 --- a/waflib/Scripting.py +++ b/waflib/Scripting.py @@ -332,7 +332,12 @@ def distclean(ctx): else: remove_and_log(env.out_dir, shutil.rmtree) - for k in (env.out_dir, env.top_dir, env.run_dir): + env_dirs = [env.out_dir] + if not ctx.options.no_lock_in_top: + env_dirs.append(env.top_dir) + if not ctx.options.no_lock_in_run: + env_dirs.append(env.run_dir) + for k in env_dirs: p = os.path.join(k, Options.lockfile) remove_and_log(p, os.remove)