[jhbuild] Warn about cyclic deps in checkmodulesets command (GNOME bug 676224)



commit de3a07d4fea33f0a9ba07fc992612a3c6f4592b6
Author: Craig Keogh <cskeogh adam com au>
Date:   Fri Jun 8 11:28:47 2012 +0930

    Warn about cyclic deps in checkmodulesets command (GNOME bug 676224)

 jhbuild/commands/checkmodulesets.py |    3 ++-
 jhbuild/moduleset.py                |    7 ++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/commands/checkmodulesets.py b/jhbuild/commands/checkmodulesets.py
index 884991c..9f436da 100644
--- a/jhbuild/commands/checkmodulesets.py
+++ b/jhbuild/commands/checkmodulesets.py
@@ -32,7 +32,8 @@ class cmd_checkmodulesets(Command):
 
     def run(self, config, options, args, help=None):
         module_set = jhbuild.moduleset.load(config)
-        module_list = module_set.get_full_module_list()
+        module_list = module_set.get_full_module_list \
+                          (warn_about_circular_dependencies = True)
         for mod in module_list:
             if mod.type in ('meta', 'tarball'):
                 continue
diff --git a/jhbuild/moduleset.py b/jhbuild/moduleset.py
index 0ced9b7..9fc45a3 100644
--- a/jhbuild/moduleset.py
+++ b/jhbuild/moduleset.py
@@ -91,7 +91,8 @@ class ModuleSet:
         return module_list
 
     def get_full_module_list(self, module_names='all', skip=[],
-                                include_suggests=True, include_afters=False):
+                                include_suggests=True, include_afters=False,
+                                warn_about_circular_dependencies=False):
 
         def dep_resolve(node, resolved, seen, after):
             ''' Recursive depth-first search of the dependency tree. Creates
@@ -125,6 +126,10 @@ class ModuleSet:
                             # Translation of string not required - used in
                             # unit tests only
                             raise UsageError('Circular dependencies detected')
+                        if warn_about_circular_dependencies:
+                            self._warn(_('Circular dependencies detected: %s') \
+                                       % ' -> '.join([i.name for i in seen] \
+                                                     + [edge.name]))
                         break
                     else:
                         if edge_name in node.after:



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