diff options
author | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-25 22:38:40 (GMT) |
---|---|---|
committer | Daniel Narvaez <dwnarvaez@gmail.com> | 2012-12-25 22:38:40 (GMT) |
commit | 8e4344d34677cb98232126b23b57abde90f4ac38 (patch) | |
tree | 845dbc4bc143db6182faf7fbe7f4a54cb9ed8c85 | |
parent | 2d7c8c85bbf3022e3da37fa9fc4368b4e15ece85 (diff) |
Just empty dirs instead of removing them
Otherwise it becomes complicated to make
cleanup work after config.setup.
-rw-r--r-- | devbot/build.py | 12 |
1 files changed, 6 insertions, 6 deletions
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) |