]> Frank Brehm's Git Trees - profitbricks/jenkins-build-scripts.git/commitdiff
gentoo_build: Create directory if it does not exist already.
authorBenjamin Drung <benjamin.drung@profitbricks.com>
Fri, 24 Jan 2014 10:15:43 +0000 (11:15 +0100)
committerBenjamin Drung <benjamin.drung@profitbricks.com>
Fri, 24 Jan 2014 10:15:43 +0000 (11:15 +0100)
gentoo_build

index 4de5d5ac1a4b49b9bfa020d76808c20898dd9116..b4e9f57ed6afdccd80bb80b6708c2ba8a345fbc8 100755 (executable)
@@ -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()