Hi,

I am bothered by the fact that the project's name is google_analytics - with an underscore.

And the module's name is googleanalytics - without it.

So when I "drush dl google_analytics" all is fine , but when I try to "drush enable google_analytics" I get an error...

Is it possible that you rename all files in the CVS repo from googleanalytics to google_analytics ?

I can help with the exact commands for that.

Comments

hass’s picture

Status: Active » Postponed

This would break the .install file and all version numbers. I thought some times about this rename, but haven't done it. I believe it's easier to rename the folder, but we also loose the CVS history and I know it may take months to find someone to move it for us.

budda’s picture

See http://drupal.org/node/367355 for the rule about module names not containing an underscore. if anything, the directory/project name would have to be changed.

hass’s picture

This seems not correct, see http://drupal.org/node/367355#comment-1233292.

If a submodule is used you need to use underscores and you should always prefix your submodules with the main directory name to prevent collisions with other modules. See xmlsitemap (xmlsitemap_node, xmlsitemap_user) and nodewords (nodewords_basic, nodewords_extra) and others... what also brings us back to rsvelko... If you install a module wiht drush having submodules you may always need to know it's names.

shark’s picture

I also got confused when
drush dl google_analytics
worked but
drush enable google_analytics
didn't.

If changing the name of the actual project / module (adding an underscore) is too hard, my vote is to change the directory name to googleanalytics. I think Drush is becoming quite popular and this functionality will be increasingly important.

hass’s picture

How do you enabe xmlsitemap submodules and views or cck? I do not see differences... :-)

hass’s picture

Title: with or without an underscore in the module's filename » Submodule names in module package need guessing
Project: Google Analytics » Drush
Version: 6.x-2.x-dev »
Status: Postponed » Active

Moving to drush to get some more ideas about this problem.

moshe weitzman’s picture

Status: Active » Fixed

drush dl takes a projct name as defined by project node on drupal.org. drush enable takes the name of a module (not a project). hope that helps.

rsvelko’s picture

I have an enhanced version (via a bash wrapper) of drush dl - that at the end scans the project's folder and gets all .module files and offers a prewritten dr enable command with their names... This does the trick - especially for multi-submodules...

So although that having googleanalytics is not the best practice - a patch to "drush dl" would make this unimportant.

Imagine this scenario:
---------
# drush dl project1 .... download ok...
# Which modules from project1 do you want to enable ? Press the corresponding characters with commas if more than one:
a - all
1 - module_name1
2 - module2
...
Enter numbers: 1,3,6

Doing a:
drush enable module_name1 ....
(drush enable's output ...)
ready
---------------

moshe weitzman’s picture

Nifty. We could use some kind of multiple choice variant of drush_choice(). enabling a bunch of modules, one by one, is expensive.

greg.1.anderson’s picture

Yes, I agree with #8 and #9.

In addition, although I haven't looked at the code, I imagine that if drush dl can be smart enough to offer to enable the right module names, couldn't drush en also be smart enough to figure out what the module name should be if someone enters in a project name (presuming that the arg cannot be found as a module name, but can be found as a project name)?

Both techniques would be helpful.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AdrianB’s picture

Subscribing. (I got hit by this googleanalytics/google_analytics issue in Drush. Not a big issue since I know where to look, but always annoying when modules uses other names than d.o. project path name when you're used to the ease of Drush.)

kotnik’s picture

Subscribing.

Also, this is affected by seo_checklist/seochecklist.

owen barton’s picture

Component: Code » PM (dl, en, up ...)

I have added an API function that could to the multiple selection mentioned in #9 over at #1007578: Add the ability to enter a csv list of items to drush_choice_multiple