[jhbuild] sanitycheck: try creating jhbuild directories before checking they're writable



commit 86304684332630e7026997848b0546391620cd69
Author: Frédéric Péters <fpeters 0d be>
Date:   Fri Feb 28 20:41:35 2014 +0100

    sanitycheck: try creating jhbuild directories before checking they're writable

 jhbuild/commands/sanitycheck.py |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/jhbuild/commands/sanitycheck.py b/jhbuild/commands/sanitycheck.py
index c1e7708..3c6bd0e 100644
--- a/jhbuild/commands/sanitycheck.py
+++ b/jhbuild/commands/sanitycheck.py
@@ -51,7 +51,14 @@ class cmd_sanitycheck(Command):
     def run(self, config, options, args, help=None):
         if args:
             raise UsageError(_('no extra arguments expected'))
-    
+
+        # try creating jhbuild directories before checking they are accessible.
+        try:
+            os.makedirs(config.checkoutroot)
+            os.makedirs(config.prefix)
+        except OSError:
+            pass
+
         # check whether the checkout root and install prefix are writable
         if not (os.path.isdir(config.checkoutroot) and
                 os.access(config.checkoutroot, os.R_OK|os.W_OK|os.X_OK)):


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