bin/chroot-maint (mkdir_p): Create absolute paths correctly.
[distorted-chroot] / bin / chroot-maint
index 5b63037..a24d173 100755 (executable)
@@ -618,7 +618,8 @@ def mkdir_p(dir, mode = 0777):
 
   Unlike `OS.makedirs', this doesn't fail if DIR already exists.
   """
-  d = ""
+  if dir.startswith("/"): d = "/"; dir = dir[1:]
+  else: d = ""
   for p in dir.split("/"):
     d = OS.path.join(d, p)
     if d == "": continue