[jhbuild] check tarball directory is created correctly, and writable



commit b34d998f4fad9b09561898c1a5b5daad9f1f2051
Author: Frederic Peters <fpeters 0d be>
Date:   Fri May 1 11:33:20 2009 +0200

    check tarball directory is created correctly, and writable
---
 jhbuild/versioncontrol/tarball.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/jhbuild/versioncontrol/tarball.py b/jhbuild/versioncontrol/tarball.py
index 9244bd9..e91a172 100644
--- a/jhbuild/versioncontrol/tarball.py
+++ b/jhbuild/versioncontrol/tarball.py
@@ -179,7 +179,13 @@ class TarballBranch(Branch):
     def _download_and_unpack(self, buildscript):
         localfile = self._local_tarball
         if not os.path.exists(self.config.tarballdir):
-            os.makedirs(self.config.tarballdir)
+            try:
+                os.makedirs(self.config.tarballdir)
+            except OSError:
+                raise FatalError(
+                        _('tarball dir (%s) can not be created') % self.config.tarballdir)
+        if not os.access(self.config.tarballdir, os.R_OK|os.W_OK|os.X_OK):
+            raise FatalError(_('tarball dir (%s) must be writable') % self.config.tarballdir)
         try:
             self._check_tarball()
         except BuildStateError:



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