diff options
author | Ben Boeckel <mathstuf@gmail.com> | 2015-09-11 01:22:16 -0400 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-09-12 21:58:57 +0300 |
commit | fefae6e2367e13bdc92108be7eb6449a324703e9 (patch) | |
tree | dc5a2d406592a2ec76fd403622a572e0a81f975f | |
parent | 684168762d399ad5f4699bef6ab0bb04146077ab (diff) | |
download | obnam-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-x | check | 2 | ||||
-rwxr-xr-x | setup.py | 6 |
2 files changed, 6 insertions, 2 deletions
@@ -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 "$@" @@ -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): |