catalog: associate packages to their full_name
authorAlexandre Terrasa <alexandre@moz-code.org>
Tue, 15 Aug 2017 20:09:05 +0000 (16:09 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Tue, 26 Sep 2017 15:10:05 +0000 (11:10 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/catalog.nit

index 5516f52..c5fcfc2 100644 (file)
@@ -268,6 +268,9 @@ class Catalog
        # used to access the files and count source lines of code
        var modelbuilder: ModelBuilder
 
+       # List of all packages by their names
+       var mpackages = new HashMap[String, MPackage]
+
        # Packages by tag
        var tag2proj = new MultiHashMap[String, MPackage]
 
@@ -342,6 +345,7 @@ class Catalog
        # Compute information for a package
        fun package_page(mpackage: MPackage)
        do
+               mpackages[mpackage.full_name] = mpackage
                var score = score[mpackage].to_f
 
                var mdoc = mpackage.mdoc_or_fallback