[jhbuild] display message on deprecated options in jhbuildrc



commit 68157784bc6ffe2a7bb43f0fc74e65a613f5e522
Author: Frederic Peters <fpeters 0d be>
Date:   Wed Apr 29 21:51:33 2009 +0200

    display message on deprecated options in jhbuildrc
    
    Inform the user about some deprecated configuration options (cvsroot,
    cvsroots, svnroots) that are all superseded by "repos".
---
 jhbuild/config.py |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/jhbuild/config.py b/jhbuild/config.py
index 3e9ec71..78c63ce 100644
--- a/jhbuild/config.py
+++ b/jhbuild/config.py
@@ -142,11 +142,20 @@ class Config:
 
         # backward compatibility, from the days when jhbuild only
         # supported Gnome.org CVS.
-        if config.has_key('cvsroot'):
-            config['cvsroots']['gnome.org'] = config['cvsroot']
-        if config.has_key('cvsroots'):
+        if config.get('cvsroot'):
+            print >> sys.stderr, uencode(
+                    _('W: the "%s" configuration variable is deprecated, '
+                      'you should use "repos[\'gnome.org\']".') % 'cvsroot')
+            config['repos'].update({'gnome.org': config['cvsroot']})
+        if config.get('cvsroots'):
+            print >> sys.stderr, uencode(
+                    _('W: the "%s" configuration variable is deprecated, '
+                      'you should use "repos".') % 'cvsroots')
             config['repos'].update(config['cvsroots'])
-        if config.has_key('svnroots'):
+        if config.get('svnroots'):
+            print >> sys.stderr, uencode(
+                    _('W: the "%s" configuration variable is deprecated, '
+                      'you should use "repos".') % 'svnroots')
             config['repos'].update(config['svnroots'])
 
         # environment variables



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