[development] how to identify "root" modules?
Cog Rusty
cog.rusty at gmail.com
Sun Oct 14 12:00:29 UTC 2007
On 10/14/07, Jakob Petsovits <jpetso at gmx.at> wrote:
> 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.
Dependencies is not such a reliable way. Independent modules can be of
two kinds. Either the main bare-bones module without additional bells
and whistles, or auxiliary utility modules which are leaves in the
dependencies tree. An example is the ecommerce module where there are
at least two modules on which others depend, "store" (which I believe
is the main one) and "ec_common", none of which is located in the
package's root.
> 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