module dependency management

I don't like the idea that dependencies are not handled in a unified way. By that I mean that both module.inc and update.php code is written to handle module status. There should be a central library handling their dependencies. When we handle this in a unified way installing a big project like ubercart is easy.

When installing/enabling a module it is important to know what this module is dependent of. Ie uc_cart is dependent of uc_order. See ie http://build2be.com/sites/build2be.com/files/ubercart.neato.png

Disabling or uninstalling a module means that reverse dependent modules needs to be disabled or uninstalled too.

Listing all dependencies for a drupal install by inspecting all info files for the dependencies field we can calculate the reverse dependencies. By doing this missing modules are found too. This opens way to displaying missing project names or download projects.

On a graph (of dependencies) one can walk a path like uc_cart -> uc_order -> token. This means that in order to install uc_cart first uc_order needs to get installed. And even before uc_order token needs to get installed.

Using graph theory will give us the possibility to calculate a Topological Sorted List based on just one module name to to change status (install, uninstall, enable, disable, update, upgrade). Because following the path reveals all dependent modules. This would improve the user interface a lot. Just one checkbox to check.

References:
- http://www.csse.monash.edu.au/~lloyd/tildeAlgDS/Graph/DAG/ has a nice test tool for calculating a TSL.