summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Boeckel <mathstuf@gmail.com>2015-09-11 01:22:16 -0400
committerLars Wirzenius <liw@liw.fi>2015-09-12 21:58:57 +0300
commitfefae6e2367e13bdc92108be7eb6449a324703e9 (patch)
treedc5a2d406592a2ec76fd403622a572e0a81f975f
parent684168762d399ad5f4699bef6ab0bb04146077ab (diff)
downloadobnam-fefae6e2367e13bdc92108be7eb6449a324703e9.tar.gz
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 <mathstuf@gmail.com>
-rwxr-xr-xcheck2
-rwxr-xr-xsetup.py6
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):