summaryrefslogtreecommitdiffstats
path: root/source-builder/sb/path.py
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2013-04-15 11:15:01 +1000
committerChris Johns <chrisj@rtems.org>2013-04-15 11:15:01 +1000
commit255e032baba70f276d06f713bc45fbba143d8bf1 (patch)
tree1e17c51c5b07470454e7c7b957cd3864941c48dc /source-builder/sb/path.py
parentPR 2116 - Fix the option parsing to handle both ' ' and '='. (diff)
downloadrtems-source-builder-255e032baba70f276d06f713bc45fbba143d8bf1.tar.bz2
PR 2115 - Fix checking when the path does not fully exist.
Diffstat (limited to 'source-builder/sb/path.py')
-rw-r--r--source-builder/sb/path.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/source-builder/sb/path.py b/source-builder/sb/path.py
index 35907e4..6a52653 100644
--- a/source-builder/sb/path.py
+++ b/source-builder/sb/path.py
@@ -92,6 +92,14 @@ def isabspath(path):
def iswritable(path):
return os.access(host(path), os.W_OK)
+def ispathwritable(path):
+ path = host(path)
+ while len(path) != 0:
+ if os.path.exists(path):
+ return iswritable(path)
+ path = os.path.dirname(path)
+ return False
+
def mkdir(path):
path = host(path)
if exists(path):