summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buildtools/wafsamba/samba_utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 54ceba9103..bffe98dcd8 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -308,7 +308,12 @@ def recursive_dirlist(dir, relbase, pattern=None):
def mkdir_p(dir):
'''like mkdir -p'''
- if not dir or os.path.isdir(dir):
+ if not dir:
+ return
+ if dir.endswith("/"):
+ mkdir_p(dir[:-1])
+ return
+ if os.path.isdir(dir):
return
mkdir_p(os.path.dirname(dir))
os.mkdir(dir)