summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim MacArthur <jim+gitlab@mode7.co.uk>2018-11-07 12:26:06 +0000
committerJim MacArthur <jim+gitlab@mode7.co.uk>2018-11-07 12:26:06 +0000
commit8931e42c252a4dd02469343a6ba6220d2d0b4b59 (patch)
treecb8cb21b48ae372805f0609d7bbf503c751e22f4
parent029ba17dd7c4f5cd2f7180e9252fdd5376143816 (diff)
parent261e2cd30ca126841265673c7edf8a1d0cd2a2d2 (diff)
downloadbuildstream-8931e42c252a4dd02469343a6ba6220d2d0b4b59.tar.gz
Merge branch 'jmac/make_writable_combination' into 'master'
Use _force_rmtree instead of custom code. Closes #735 See merge request BuildStream/buildstream!927
-rw-r--r--buildstream/element.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/buildstream/element.py b/buildstream/element.py
index 8ec06090c..31ca5d307 100644
--- a/buildstream/element.py
+++ b/buildstream/element.py
@@ -1410,16 +1410,9 @@ class Element(Plugin):
finally:
# Staging may produce directories with less than 'rwx' permissions
- # for the owner, which will break tempfile, so we need to use chmod
- # occasionally.
- def make_dir_writable(fn, path, excinfo):
- os.chmod(os.path.dirname(path), 0o777)
- if os.path.isdir(path):
- os.rmdir(path)
- else:
- os.remove(path)
- shutil.rmtree(temp_staging_directory, onerror=make_dir_writable)
-
+ # for the owner, which breaks tempfile. _force_rmtree will deal
+ # with these.
+ utils._force_rmtree(temp_staging_directory)
# Ensure deterministic mtime of sources at build time
vdirectory.set_deterministic_mtime()
# Ensure deterministic owners of sources at build time