Mercurial > hg > config
diff python/unroll_deps.py @ 150:ef01512b2212
fixes; doesnt quite work
author | Jeff Hammel <jhammel@mozilla.com> |
---|---|
date | Tue, 12 Jul 2011 17:25:21 -0700 |
parents | 05e461e4b409 |
children | f89c3615b414 |
line wrap: on
line diff
--- a/python/unroll_deps.py Tue Jul 12 13:48:50 2011 -0700 +++ b/python/unroll_deps.py Tue Jul 12 17:25:21 2011 -0700 @@ -4,6 +4,7 @@ """unroll dependencies""" order = [] for package, deps in dependencies.items(): + print package, order try: index = order.index(package) except ValueError: @@ -12,14 +13,14 @@ for dep in deps: try: dep_index = order.index(dep) - assert dep_index < index, "Cyclic dependencies detected" + assert dep_index < index, "Cyclic dependencies detected: %s, %s" % (package, dep) except ValueError: order.insert(index, dep) return order if __name__ == '__main__': deps = {'packageA': set(['packageB', 'packageC']), - 'packageB': set(['packageC', 'packageD']), - 'packageC': set()} + 'packageB': set(['packageC', 'packageD', 'packageE']), + 'packageC': set(['packageE'])} unrolled = unroll_dependencies(deps) print unrolled