diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-21 17:37:10 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-21 17:37:10 +0900 |
commit | c568739cd19ef4e48da963938cf31ab34e5d20a6 (patch) | |
tree | 35912204e6bfea15a74b5922da375e5d06cfe63f | |
parent | 41f8e86ce96ec72faccace111290a36be73ecd7c (diff) | |
download | buildstream-c568739cd19ef4e48da963938cf31ab34e5d20a6.tar.gz |
utils.py: Fix regression, build directories not being removed.
utils._force_rmtree() was overwriting it's path directory, and
then only recursively removing the last entry which was walked.
-rw-r--r-- | buildstream/utils.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/buildstream/utils.py b/buildstream/utils.py index 2a873bf57..f48a7e4b5 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -467,14 +467,14 @@ def get_bst_version(): # Recursively remove directories, ignoring file permissions as much as # possible. -def _force_rmtree(path, **kwargs): - for root, dirs, _ in os.walk(path): +def _force_rmtree(rootpath, **kwargs): + for root, dirs, _ in os.walk(rootpath): for d in dirs: path = os.path.join(root, d.lstrip('/')) if os.path.exists(path) and not os.path.islink(path): os.chmod(path, 0o755) - shutil.rmtree(path, **kwargs) + shutil.rmtree(rootpath, **kwargs) # Recursively make directories in target area |