[Piuparts-commits] [piuparts] 08/11: p: Chroot: add mkdir_p(path) method

Holger Levsen holger at moszumanska.debian.org
Fri Jan 23 12:18:05 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit 0719de5114becce8c736e20dbebb3517ba73efb6
Author: Andreas Beckmann <anbe at debian.org>
Date:   Sun Jan 18 05:42:31 2015 +0100

    p: Chroot: add mkdir_p(path) method
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 piuparts.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/piuparts.py b/piuparts.py
index efc56d8..e563af7 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -862,6 +862,11 @@ class Chroot:
             return run(["chroot", self.name] + prefix + command,
                    ignore_errors=ignore_errors, timeout=settings.max_command_runtime)
 
+    def mkdir_p(self, path):
+        fullpath = self.relative(path)
+        if not os.path.isdir(fullpath):
+            os.makedirs(fullpath)
+
     def create_apt_sources(self, distro):
         """Create an /etc/apt/sources.list with a given distro."""
         lines = []

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list