jhbuild r2680 - in trunk: . jhbuild jhbuild/commands



Author: fpeters
Date: Mon Feb  2 09:45:07 2009
New Revision: 2680
URL: http://svn.gnome.org/viewvc/jhbuild?rev=2680&view=rev

Log:
* jhbuild/commands/bot.py:
* jhbuild/config.py: reload (parts of) jhbuild configuration file when
buildbot server is sent SIGHUP (everything but environment variables).



Modified:
   trunk/ChangeLog
   trunk/jhbuild/commands/bot.py
   trunk/jhbuild/config.py

Modified: trunk/jhbuild/commands/bot.py
==============================================================================
--- trunk/jhbuild/commands/bot.py	(original)
+++ trunk/jhbuild/commands/bot.py	Mon Feb  2 09:45:07 2009
@@ -262,6 +262,8 @@
                     log.msg("error while parsing config file")
                     raise
 
+                jhbuild_config.load()
+
                 try:
                     config = localDict['BuildmasterConfig']
                 except KeyError:

Modified: trunk/jhbuild/config.py
==============================================================================
--- trunk/jhbuild/config.py	(original)
+++ trunk/jhbuild/config.py	Mon Feb  2 09:45:07 2009
@@ -92,24 +92,29 @@
 
 class Config:
     def __init__(self, filename=_default_jhbuildrc):
-        config = {
+        self._config = {
             '__file__': _defaults_file,
             'addpath':  addpath,
             'prependpath':  prependpath
             }
         env_prepends.clear()
         try:
-            execfile(_defaults_file, config)
+            execfile(_defaults_file, self._config)
         except:
             traceback.print_exc()
             raise FatalError(_('could not load config defaults'))
-        config['__file__'] = filename
+        self._config['__file__'] = filename
         self.filename = filename
         if not os.path.exists(filename):
             raise FatalError(_('could not load config file, %s is missing') % filename)
 
+        self.load()
+        self.setup_env()
+
+    def load(self):
+        config = self._config
         try:
-            execfile(filename, config)
+            execfile(self.filename, config)
         except Exception:
             traceback.print_exc()
             raise FatalError(_('could not load config file'))
@@ -159,8 +164,6 @@
             if checkout_mode not in possible_checkout_modes:
                 raise FatalError(_('invalid checkout mode (module: %s)') % module)
 
-        self.setup_env()
-
     def setup_env(self):
         '''set environment variables for using prefix'''
 
@@ -292,3 +295,4 @@
                 v = False
 
         self.__dict__[k] = v
+



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