Command to see modules within a project

Events happening in the community are now at Drupal community events on www.drupal.org.
eporama's picture

Is there any drush command to see which modules are included within a project? You can download a project, "cck", for example, and you need to enable "content", "text", "fieldgroup", etc. The only way I've found to see what "cck" packaged was to do a statusmodules command and see what changed (or to look directly for .info files within the folder).

Sometimes I just can't remember all of the modules of a project and forget to enable "views_ui", for another example. Then I wonder why "drush --yes en views" worked, but I don't see any change on my website... Then look at the /admin/build/modules page and slap my forehead and enable "views_ui".

Thanks.

Comments

Interested Too

Scott McCabe's picture

I'm also interested in this.

Learning Drush recently, I was able to 'drush dl google_analytics' fine, but multiple efforts to 'drush en' (e.g. google_analytics, "Google Analytics") failed.

I have been too busy to search the issue queue on this. Is there something already there that we can link to?

re: Interested too

John_Buehrer's picture

The packagers blew it, they deleted an underscore between the downloading and enabling phases:

$ drush  -r ...  dl  google_analytics
$ drush  -r ...  -y  en  googleanalytics

It's a shame those guys don't realize how a small negligence can lead to huge wastes of time for users. I've seen other examples like this; how can we improve the situation?

Almost there

jonhattan's picture

There's an ongoing issue to implement drush pm-list --package=cck -> http://drupal.org/node/654682

Note statusmodules is pm-list in drush 3.x, and it also list themes.

seems like find would address

moshe weitzman's picture

seems like find would address this need.

jonhattan's picture

$ drush dl views
Project views (7.x-3.x-dev) downloaded to /var/www/drupal-7.x-cvs/sites/all/modules/views.                         [success]
Project views contains 4 modules: views_export, views_test, views, views_ui.                                       [success]

This won't be available in the 3.x series as of http://drupal.org/node/866716#comment-3405374

Show modules not enabled ?

John_Buehrer's picture

Is there a way to show modules not enabled, with a systematic output format like --pipe?
The use-case is general automation and reporting.

This seems to work better for cck than content_lock,
where the Perl snippet below misses content_lock_timeout.

$ alias dr='drush -r mySite'

$ dr pm-list | grep lock
Core - required   Block (block)                                    Module  Enabled        6.19
Drupal Wiki       Content locking (edit lock) (content_lock)       Module  Not installed  6.x-2.2
Drupal Wiki       Content locking (edit lock) timeouts             Module  Not installed  6.x-2.2
                   (content_lock_timeout)

$ dr pm-list --package=content_lock | grep -i 'not installed'

$ dr pm-list --package=content_lock
Name  Type  Status  Version

$ dr pm-list --pipe | grep content_lock
content_lock
content_lock_timeout

$ dr pm-list  | perl -ne '
>       next unless /^.+(([^(]+))\s+module\s+not\s+installed/i;
>       $module = $1;
>       next unless $module =~ /content_lock/;
>       print $module."\n";
> '
content_lock

$ dr pm-list --package=cck | grep -i 'not installed'
Content (content)                          Module  Not installed  6.x-2.6
Content Copy (content_copy)                Module  Not installed  6.x-2.6
Content Permissions (content_permissions)  Module  Not installed  6.x-2.6
Fieldgroup (fieldgroup)                    Module  Not installed  6.x-2.6
Node Reference (nodereference)             Module  Not installed  6.x-2.6
Number (number)                            Module  Not installed  6.x-2.6
Option Widgets (optionwidgets)             Module  Not installed  6.x-2.6
Text (text)                                Module  Not installed  6.x-2.6
User Reference (userreference)             Module  Not installed  6.x-2.6

$ dr pm-list --package=cck | perl -ne '
      next unless /^.+(([^(]+))\s+module\s+not\s+installed/i;
      $module = $1;
      print $module."\n";                                               
'
content
content_copy
content_permissions
fieldgroup
nodereference
number
optionwidgets
text
userreference

BTW, isn't there a difference between "not installed" and "not enabled"?
I think "installed" is more like "downloaded" than "enabled".

Please use separate posts for different questions

jonhattan's picture

Please use separate posts for different questions.

What you're looking for is explained in the help for pm-list.

drush pm-list --status="disabled,not installed" --pipe

Thanks

John_Buehrer's picture

Will check it.

drush

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: