From: Mark Wooding Date: Fri, 20 Sep 2019 10:01:14 +0000 (+0100) Subject: bin/chroot-maint (mkdir_p): Create absolute paths correctly. X-Git-Url: https://git.distorted.org.uk/~mdw/distorted-chroot/commitdiff_plain/1633cd4f5199e1f2ed1da107d1429646f09d58b8 bin/chroot-maint (mkdir_p): Create absolute paths correctly. --- diff --git a/bin/chroot-maint b/bin/chroot-maint index 5b63037..a24d173 100755 --- a/bin/chroot-maint +++ b/bin/chroot-maint @@ -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