[Piuparts-commits] [piuparts] 02/02: p: use mkdir_p() more often

Holger Levsen holger at moszumanska.debian.org
Sat Oct 17 10:13:01 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 34a293911eebe6295b28cfe773887073f0bbf1a0
Author: Andreas Beckmann <anbe at debian.org>
Date:   Fri Oct 16 14:36:01 2015 +0200

    p: use mkdir_p() more often
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 piuparts.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/piuparts.py b/piuparts.py
index d0cc432..2c296a2 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -735,9 +735,8 @@ class Chroot:
         # Copy scripts dirs into the chroot, merging all dirs together,
         # later files overwriting earlier ones.
         if settings.scriptsdirs:
+            self.mkdir_p("tmp/scripts/")
             dest = self.relative("tmp/scripts/")
-            if not os.path.exists(self.relative("tmp/scripts/")):
-                os.mkdir(dest)
             for sdir in settings.scriptsdirs:
                 logging.debug("Copying scriptsdir %s to %s" % (sdir, dest))
                 for sfile in os.listdir(sdir):
@@ -955,8 +954,7 @@ class Chroot:
             lines.append('force-confdef\n')
             logging.info("Warning: dpkg has been configured to use the force-confdef option. This will hide problems, see #466118.")
         if lines:
-            if not os.path.exists(self.relative("etc/dpkg/dpkg.cfg.d")):
-                os.mkdir(self.relative("etc/dpkg/dpkg.cfg.d"))
+            self.mkdir_p("etc/dpkg/dpkg.cfg.d")
             create_file(self.relative("etc/dpkg/dpkg.cfg.d/piuparts"),
                         "".join(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