[jhbuild] tarball: delay check for writable tarballdir



commit 07ccd35d48bb72038344c46af5b2a01cc0f608f7
Author: Ryan Lortie <desrt desrt ca>
Date:   Mon Mar 16 22:24:47 2015 -0400

    tarball: delay check for writable tarballdir
    
    It's possible to imagine jhbuild used in a situation where the tarball
    directory may not be writable by the user who is running it, including
    in the case where the tarballdir is a read-only bind mount.
    
    For that reason, skip the check on startup for tarballdir being
    read-only and delay it to the point where we would actually try to
    download the file.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=746327

 jhbuild/versioncontrol/tarball.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/versioncontrol/tarball.py b/jhbuild/versioncontrol/tarball.py
index 137e5d8..3ea4080 100644
--- a/jhbuild/versioncontrol/tarball.py
+++ b/jhbuild/versioncontrol/tarball.py
@@ -196,6 +196,8 @@ class TarballBranch(Branch):
                 logging.warning(_('skipped hash check (missing support for %s)') % algo)
 
     def _download_tarball(self, buildscript, localfile):
+        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)
         """Downloads the tarball off the internet, using wget or curl."""
         extra_env = {
             'LD_LIBRARY_PATH': os.environ.get('UNMANGLED_LD_LIBRARY_PATH'),
@@ -224,8 +226,6 @@ class TarballBranch(Branch):
             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]