[jhbuild] check copy_dir is set when the copy checkout mode is used



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

    check copy_dir is set when the copy checkout mode is used
---
 jhbuild/config.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/jhbuild/config.py b/jhbuild/config.py
index 556270c..fc5258c 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -172,12 +172,16 @@ class Config:
         if not self.tarballdir: self.tarballdir = self.checkoutroot
 
         # check possible checkout_mode values
+        seen_copy_mode = (self.checkout_mode == 'copy')
         possible_checkout_modes = ('update', 'clobber', 'export', 'copy')
         if self.checkout_mode not in possible_checkout_modes:
             raise FatalError(_('invalid checkout mode'))
         for module, checkout_mode in self.module_checkout_mode.items():
+            seen_copy_mode = seen_copy_mode or (checkout_mode == 'copy')
             if checkout_mode not in possible_checkout_modes:
                 raise FatalError(_('invalid checkout mode (module: %s)') % module)
+        if seen_copy_mode and not self.copy_dir:
+            raise FatalError(_('copy mode requires copy_dir to be set'))
 
     def setup_env(self):
         '''set environment variables for using prefix'''



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