Hi.
This is a functional (as in it worked once for ubercart) patch for:
- generating a dot file (drush pm dot)
- enabling modules (drush pm enable forum)
- disabling modules (drush pm disable forum)
Working examples:
.../drush .... pm enable forum
.../drush .... pm disable forum
.../drush .... pm dot | dot -t png -o ~/test.dot
I'm not sure why it doesn't work for ubercart. Perhaps pm disable uc_cart was disabling too much or module_disabled was to lazy to check?
When testing the patch uncomment the lines where module_enable / module_disable calls are.
Please test and give feedback on these
.../drush .... pm enable uc_cart
.../drush .... pm disable uc_cart (this is not working for a complex tree yet... i know what to do next)
What the code does is:
- generating a list of module info from the 3 three drupal modules locations.
- from that list a dependency tree is build for the given modules to enable/disable.
- that tree is then Topological Sorted for the right order of module enabling.
Regards,
Clemens Tolboom
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | drush-mm.patch | 14.85 KB | clemens.tolboom@drupal.org |
| #6 | drush-mm.patch | 14.79 KB | clemens.tolboom |
| #5 | drush-mm.patch | 14.72 KB | clemens.tolboom |
| drush-pm-dot-enable-disable.patch | 8.35 KB | clemens.tolboom |
Comments
Comment #1
clemens.tolboomHold your horses... when enabling a module with dependencies to not installed modules the dependency checker fails to halt and just enables the give sub graph.
Scenario
I should have checked for the unavailable views and views_rss!
But you can use it for
drush pm dot | dot -T png -o graph.png;-)Comment #2
moshe weitzman commentedI'm not putting the graph stuff in drush. Please work with Drupal 7 to nicely expose the dependency checker and hook_requirements so we can just re-use core. Also please help to get updates to happen in right order. See http://drupal.org/node/211182.
If you really need this functionality, please maintain your own set of drush commands. pm is meant to stay clean and close to core.
Unified diffs are preferred. See diff and patch.
Comment #3
clemens.tolboomI don't understand completely. This code (without the dot stuff and errs) is about enabling modules! Which is super when installing ton's of sites.
Do you want me to deliver a module manager instead? That's fine with me. Then you add them to drush?
About drupal 7 ... do you know who I can talk to?
(Sorry about the patch type ... i was in a hurry)
Regards,
Clemens
Comment #4
moshe weitzman commentedto contribute to D7, see http://drupal.org/contribute/development. follow the links from there.
Comment #5
clemens.tolboomOk I've created a new module mm (module manager) with the following command.
I'll will note this patch on the develop mailing list today too and hope to talk @ FOSDEM about my thought about this patch and D6 and D7.
It tested it with ubercart installation only
- drush pm install ubercart (and dependant project)
- drush mm list
- drush mm enable uc_cart
- drush mm disable uc_cart
- drush mm uninstall uc_cart
This patch fixes a lot of annoyances for me while installing ie ubercart. But it gives me also the opportunity to graph a modules installation with green (installed), yellow (available), red (in error)
commands:
- list (available modules)
- dot (make a graphviz processable file) (see http://build2be.com/content/modules-err for some colors)
- enable (dependant aware install/enable modules)
- disable (dependant aware disabling modules)
- uninstall (dependant aware disabling modules)
I hope this can help us all too fix problems for D6 and prevent them in D7 because this is about how dependencies should/could be handled.
Regards,
Clemens Tolboom
Comment #6
clemens.tolboomThere was a bug introduced by refactoring accepting the installation of a dependency on an non exisiting module. So I tested it on a clean install. And it works great.
It's a little horrifying to do a
drush mm uninstall tokenbecause a lot of modules get uninstalled in the proces but that's what the --simulate is for ;-)Doing a
drush mm listshows potential blockers for enabling a module due to a missing dependency.I hope you find time to commit this patch. Maybe we can convince D6 and D7 people to implement this 'graph'. As you may know Karoly Negyesi is 'very happy' with 'Re: [development] How to make better dependency checks in D5, D6, D7?'
Thanks again for making drush.
Regards,
Clemens
Comment #7
moshe weitzman commentedHere is a deal. If you can get this sort of functionality into core so that D7 drush only needs a small amount of code, then I will commit this big monster to the D5 and D6 versions of drush (along with the smaller patch for HEAD).
Comment #8
clemens.tolboomThat's great news.
And yes i will certainly try to get this into core. The pointers of Karoly Negyesi should help too.
What people @ FOSDEM are best to convince?
Ehhm patch (code needs work) ... What is the dependency direction? You commit and I try or the other way around? I hope the first as that's a better way to show that it could work.
Regards,
Clemens
Comment #9
clemens.tolboomI'm reworking the patch by using more drupal functions. Providing a patch for D7 is not trivial but this rework effort will make it leaner to try.
Please checkout http://build2be.com/content/configuring-ubercart and http://build2be.com/content/installing-ubercart-through-drush-pm-and-mm for my work in progress.
Comment #10
clemens.tolboom@drupal.org commentedDear Moshe,
(patch will be attached into the next comment ... i got problems in creating it :-/
could you please commit this patch. It saves me a lot of work updating my installed drush versions. I agree you do not have to tag this module for a stable release but I think it deserves serious testing through the dev tarball. This patch a a bit cleaner then the previous one. I hope it is stable enough to serve as an example for a D7 implementation.
See my documenting effort on http://build2be.com/content/module-management-drupal and watch the movie about drush_mm. Sorry for making this drush movie but discussing @ FOSDEM didn't result in 'aha erlebnis' I hope this movie helps people to understand what dependencies is about.
Regards,
Clemens
Comment #11
clemens.tolboom@drupal.org commentedSomehow eclipse takes all files from my drush_mm directory including a swap file and a test file. Now a handedited pacth file is attached. It looks good so I hope for the better :-/
Comment #12
moshe weitzman commentedSee my comments in #7 about prerequisites for taking this patch.
Comment #13
moshe weitzman commentedComment #14
clemens.tolboomYou may close this issue. Not that it is not an issue for drupal core, but i submitted my patch as a module. http://drupal.org/project/drush_mm
I decided to do it this way for securing my patch in a 'developer' environment and to get more attention.
Thanks for drush and I hope to contrib again,
Clemens