summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/path.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2015-02-07 17:58:17 +1100
committerChris Johns <chrisj@rtems.org>2015-02-07 17:58:17 +1100
commitd4eb08f55a7e868ea0e61dee03c216cdf7a3502b (patch)
tree9f98bea8a291aeb38ab93b2efb2c9865db1defae /source-builder/sb/path.py
parentUpdate all 4.11 archs to newlib-2.2.0-1 and gdb-7.8.2 where possible. (diff)
downloadrtems-source-builder-d4eb08f55a7e868ea0e61dee03c216cdf7a3502b.tar.bz2
Windows native build fixes.
The testing of building on Windows is done using MSYS2.
Diffstat (limited to 'source-builder/sb/path.py')
-rw-r--r--source-builder/sb/path.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/source-builder/sb/path.py b/source-builder/sb/path.py
index 20ab73c..67aeacd 100644
--- a/source-builder/sb/path.py
+++ b/source-builder/sb/path.py
@@ -127,7 +127,14 @@ def mkdir(path):
def removeall(path):
def _onerror(function, path, excinfo):
- print 'removeall error: (%s) %s' % (excinfo, path)
+ import stat
+ if not os.access(path, os.W_OK):
+ # Is the error an access error ?
+ os.chmod(path, stat.S_IWUSR)
+ function(path)
+ else:
+ print 'removeall error: %s' % (path)
+ raise
path = host(path)
shutil.rmtree(path, onerror = _onerror)