[elbe-devel] [PATCH v2 11/22] virtapt: remove unused mkdir_p function

Torben Hohn torben.hohn at linutronix.de
Tue Jul 2 12:55:33 CEST 2019


with bc8e702caf87 ("virtapt: massive refactoring to make it work again")
the mkdir_p implementation from the TmpdirFilesystem is used now.

remove the now unused private implementation of mkdir_p.

Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
 elbepack/virtapt.py | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 79d7123b2..4cb447be0 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -175,22 +175,6 @@ class VirtApt(object):
     def pulse(self, _obj):
         return True
 
-    def mkdir_p(self, newdir, mode=0o755):
-        """works the way a good mkdir -p would...
-                - already exists, silently complete
-                - regular file in the way, raise an exception
-                - parent directory(ies) does not exist, make them as well
-        """
-        if os.path.isdir(newdir):
-            pass
-        elif os.path.isfile(newdir):
-            raise OSError("a file with the same name as the desired "
-                          "dir, '%s', already exists." % newdir)
-        else:
-            os.makedirs(newdir, mode)
-            # mode is not set correctly
-            system("chmod 777 " + newdir)
-
     def initialize_dirs(self):
         self.basefs.mkdir_p("cache/archives/partial")
         self.basefs.mkdir_p("etc/apt/preferences.d")
-- 
2.11.0




More information about the elbe-devel mailing list