Combine _force_rmtree and make_dir_writable

Background

We have two functions which appear to do the same thing: _force_rmtree in utils.py (https://gitlab.com/BuildStream/buildstream/blob/master/buildstream/utils.py#L672) and make_dir_writable followed by rmtree in element.py (https://gitlab.com/BuildStream/buildstream/blob/master/buildstream/element.py#L1409). We should be able to combine them.

Task description

  • Investigate uses of _force_rmtree
  • Combine _force_rmtree with make_dir_writable

Acceptance Criteria

Reduced code size and equivalent functionality and performance


Edited by Jim MacArthur