From fefae6e2367e13bdc92108be7eb6449a324703e9 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Fri, 11 Sep 2015 01:22:16 -0400 Subject: build: support build/ being a symlink I use a symlink to keep build artifacts off of my main drive, so preserve the link if it exists. Signed-off-by: Ben Boeckel --- check | 2 +- setup.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/check b/check index 708ac0f8..965d507a 100755 --- a/check +++ b/check @@ -20,5 +20,5 @@ set -e python setup.py --quiet clean python setup.py --quiet build_ext -i -rm -rf build +rm -rf build/*/ python setup.py --quiet check "$@" diff --git a/setup.py b/setup.py index 47f87660..a913274b 100755 --- a/setup.py +++ b/setup.py @@ -115,7 +115,11 @@ class CleanMore(clean): self.remove_pyc('obnamlib') self.remove_pyc('test-plugins') if os.path.isdir('build'): - shutil.rmtree('build') + if os.path.islink('build'): + for path in os.listdir('build'): + shutil.rmtree('build/' + path) + else: + shutil.rmtree('build') def remove_pyc(self, rootdir): for dirname, subdirs, basenames in os.walk(rootdir): -- cgit v1.2.1