From: Benjamin Drung Date: Fri, 24 Jan 2014 10:15:43 +0000 (+0100) Subject: gentoo_build: Create directory if it does not exist already. X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=6bd01e02ece30adcdbb884f952b083bc51f4ec37;p=profitbricks%2Fjenkins-build-scripts.git gentoo_build: Create directory if it does not exist already. --- 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()