[jhbuild] merge checks against $prefix (existence, writability) into the same place



commit 096c31ef891764e4c19139f215a37a0d8fa9b32f
Author: Frederic Peters <fpeters 0d be>
Date:   Fri May 1 11:15:22 2009 +0200

    merge checks against $prefix (existence, writability) into the same place
---
 jhbuild/config.py                |    4 +++-
 jhbuild/frontends/buildscript.py |    7 -------
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/jhbuild/config.py b/jhbuild/config.py
index 78c63ce..556270c 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -186,7 +186,9 @@ class Config:
             try:
                 os.makedirs(self.prefix)
             except:
-                raise FatalError(_("Can't create %s directory") % self.prefix)
+                raise FatalError(_('install prefix (%s) can not be created') % self.prefix)
+        if not os.access(self.prefix, os.R_OK|os.W_OK|os.X_OK):
+            raise FatalError(_('install prefix (%s) must be writable') % self.prefix)
 
         os.environ['UNMANGLED_LD_LIBRARY_PATH'] = os.environ.get('LD_LIBRARY_PATH', '')
 
diff --git a/jhbuild/frontends/buildscript.py b/jhbuild/frontends/buildscript.py
index 7435d43..f63f4e0 100644
--- a/jhbuild/frontends/buildscript.py
+++ b/jhbuild/frontends/buildscript.py
@@ -40,13 +40,6 @@ class BuildScript:
                 raise FatalError(_('checkout root can not be created'))
         if not os.access(self.config.checkoutroot, os.R_OK|os.W_OK|os.X_OK):
             raise FatalError(_('checkout root must be writable'))
-        if not os.path.exists(self.config.prefix):
-            try:
-                os.makedirs(self.config.prefix)
-            except OSError:
-                raise FatalError(_('install prefix can not be created'))
-        if not os.access(self.config.prefix, os.R_OK|os.W_OK|os.X_OK):
-            raise FatalError(_('install prefix must be writable'))
 
         packagedbdir = os.path.join(self.config.prefix, 'share', 'jhbuild')
         try:



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