[jhbuild] create checkout copy directory if necessary (GNOME #580949)



commit 680ac06ef9e5a06822c574ccf5e06d2d861e3f38
Author: Frederic Peters <fpeters 0d be>
Date:   Fri May 1 11:29:36 2009 +0200

    create checkout copy directory if necessary (GNOME #580949)
---
 jhbuild/frontends/buildscript.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/jhbuild/frontends/buildscript.py b/jhbuild/frontends/buildscript.py
index 1995198..6c94da0 100644
--- a/jhbuild/frontends/buildscript.py
+++ b/jhbuild/frontends/buildscript.py
@@ -42,6 +42,15 @@ class BuildScript:
         if not os.access(self.config.checkoutroot, os.R_OK|os.W_OK|os.X_OK):
             raise FatalError(_('checkout root (%s) must be writable') % self.config.checkoutroot)
 
+        if self.config.copy_dir and not os.path.exists(self.config.copy_dir):
+            try:
+                os.makedirs(self.config.copy_dir)
+            except OSError:
+                raise FatalError(
+                        _('checkout copy dir (%s) can not be created') % self.config.copy_dir)
+            if not os.access(self.config.copy_dir, os.R_OK|os.W_OK|os.X_OK):
+                raise FatalError(_('checkout copy dir (%s) must be writable') % self.config.copy_dir)
+
         packagedbdir = os.path.join(self.config.prefix, 'share', 'jhbuild')
         try:
             if not os.path.isdir(packagedbdir):



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]