From 6bd01e02ece30adcdbb884f952b083bc51f4ec37 Mon Sep 17 00:00:00 2001 From: Benjamin Drung Date: Fri, 24 Jan 2014 11:15:43 +0100 Subject: [PATCH] gentoo_build: Create directory if it does not exist already. --- gentoo_build | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gentoo_build b/gentoo_build index 4de5d5a..b4e9f57 100755 --- a/gentoo_build +++ b/gentoo_build @@ -93,6 +93,9 @@ class Ebuild(object): def save(self, base_path): """Save the ebuild file below the given base_path.""" fullpath = os.path.join(base_path, self.get_relpath()) + parent_path = os.path.dirname(fullpath) + if not os.path.isdir(parent_path): + os.makedirs(parent_path, 0755) ebuild_file = open(fullpath, "w") ebuild_file.write(self.ebuild) ebuild_file.close() -- 2.39.5