[development] how to identify "root" modules?

Jakob Petsovits jpetso at gmx.at
Sun Oct 14 08:19:40 UTC 2007

On Friday, 12. October 2007, Gábor Hojtsy wrote:
> Why I investigated this is that I would need a stable solution to
> indentify these "root" modules in each project. We know this is system
> module in Drupal itself, but collecting a wired in list of "root"
> modules for each module suite seems like a bad idea.

You could check the dependency tree:
Most to all submodules will depend on the "root" module, so you could 
determine that one by defining it as "the module where count(is_depended_on) 
is higher than for all other modules". Of course, that comparison has to be 
restricted to the root folder of each module collection, for which I don't 
have a good idea on how to reliably determine it.

Also, this only works with projects where all modules are put together into 
one single folder structure in one single d.o project, whereas it falls down 
when third-party modules like CCK fields are separate projects.

More information about the development mailing list