"
s += r.to_s
@@ -480,7 +480,7 @@ redef class Catalog
res.add "name | \n"
res.add "maint | \n"
res.add "contrib | \n"
- if deps.not_empty then
+ if deps.vertices.not_empty then
res.add "reqs | \n"
res.add "direct reqs | \n"
res.add "clients | \n"
@@ -503,11 +503,11 @@ redef class Catalog
if p.metadata.maintainers.not_empty then maint = p.metadata.maintainers.first.name.html_escape
res.add "{maint} | "
res.add "{p.metadata.contributors.length} | "
- if deps.not_empty then
- res.add "{deps[p].greaters.length-1} | "
- res.add "{deps[p].direct_greaters.length} | "
- res.add "{deps[p].smallers.length-1} | "
- res.add "{deps[p].direct_smallers.length} | "
+ if deps.vertices.not_empty then
+ res.add "{deps.get_all_successors(p).length-1} | "
+ res.add "{deps.successors(p).length} | "
+ res.add "{deps.get_all_predecessors(p).length-1} | "
+ res.add "{deps.predecessors(p).length} | "
end
res.add "{mmodules[p]} | "
res.add "{mclasses[p]} | "
@@ -593,29 +593,13 @@ if opt_no_parse.value then
else
mmodules = modelbuilder.parse_full(args)
end
-var mpackages = new Set[MPackage]
-for m in mmodules do
- var p = m.mpackage
- if p != null then mpackages.add p
-end
+var mpackages = modelbuilder.model.mpackage_importation_graph.vertices
# Scan packages and compute information
-for p in model.mpackages do
+for p in mpackages do
var g = p.root
assert g != null
modelbuilder.scan_group(g)
-
- # Load the module to process importation information
- if opt_no_parse.value then continue
-
- catalog.deps.add_node(p)
- for gg in p.mgroups do for m in gg.mmodules do
- for im in m.in_importation.direct_greaters do
- var ip = im.mpackage
- if ip == null or ip == p then continue
- catalog.deps.add_edge(p, ip)
- end
- end
end
if not opt_no_git.value then for p in mpackages do
@@ -758,11 +742,11 @@ index.add """
index.add "Highlighted Packages
\n"
index.add catalog.list_best(catalog.score)
-if catalog.deps.not_empty then
+if catalog.deps.vertices.not_empty then
index.add "Most Required
\n"
var reqs = new Counter[MPackage]
for p in mpackages do
- reqs[p] = catalog.deps[p].smallers.length - 1
+ reqs[p] = catalog.deps.get_all_successors(p).length - 1
end
index.add catalog.list_best(reqs)
end