From 8e4344d34677cb98232126b23b57abde90f4ac38 Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Tue, 25 Dec 2012 22:38:40 +0000 Subject: Just empty dirs instead of removing them Otherwise it becomes complicated to make cleanup work after config.setup. --- (limited to 'devbot/build.py') diff --git a/devbot/build.py b/devbot/build.py index 7b4d64a..2a101e2 100644 --- a/devbot/build.py +++ b/devbot/build.py @@ -75,9 +75,8 @@ def distribute(): return True def clean(): - _rmtree(config.install_dir) - _rmtree(config.prefix_dir) - _rmtree(config.get_build_dir()) + _empty_dir(config.install_dir) + _empty_dir(config.get_build_dir()) for module in config.load_modules(): if not module.out_of_source: @@ -237,6 +236,7 @@ def _distribute_module(module, log=None): return True -def _rmtree(dir): - print "Deleting %s" % dir - shutil.rmtree(dir, ignore_errors=True) +def _empty_dir(dir_path): + print "Emptying %s directory" % dir_path + shutil.rmtree(dir_path, ignore_errors=True) + os.mkdir(dir_path) -- cgit v0.9.1