When using latest drush to build a module (interactive mode) I get:

PHP Fatal error:  Call to undefined function pm_dl_destination() in /home/rfay/workspace/commerce/sites/all/modules/module_builder/drush/module_builder.drush.inc on line 487
Drush command terminated abnormally due to an unrecoverable error.   [error]
Error: Call to undefined function pm_dl_destination() in
/home/rfay/workspace/commerce/sites/all/modules/module_builder/drush/module_builder.drush.inc,
line 487

Comments

joachim’s picture

Status: Active » Postponed (maintainer needs more info)

I'm increasingly baffled by drush versions:

$ drush version
drush version 4.5-dev

and yet:

~/Sites/_sandbox/drush joachim$ git bra
* 7.x-4.x
  remotes/origin/4.7.x-1.x
  remotes/origin/5.x-1.x
  remotes/origin/6.x-1.x
  remotes/origin/6.x-3.x
  remotes/origin/7.x-1.x
  remotes/origin/7.x-4.x
  remotes/origin/HEAD -> origin/master
  remotes/origin/debian
  remotes/origin/master
  remotes/origin/upstream
rsvelko’s picture

Priority: Normal » Major
Status: Postponed (maintainer needs more info) » Needs work

I've tracked it in the current latest Drush - the Drush 5.x branch. Now the function is called _pm_download_destination.

Replacing the pm_dl_destination call with this one still does not fix it though. The function does not exist in that context there...

For now I just added the static './sites/all/modules' and it works.

I changed the priority to major - cause it does not allow you to write anything to files now - and you have to output manually the info, moule and the rest separately and copy paste the code into files... no no no

joachim’s picture

Status: Needs work » Postponed (maintainer needs more info)

AFAIK the latest version of drush is the 7.x-4.x branch, where I find that function.

Are you on Windows, and thus using 5.x-dev? Those drush branch numbers are just all over the place :/

rfay’s picture

Current dev of drush is on the master branch...

joachim’s picture

It seems to me that the drush version numbers and the git branches that correspond to them keep changing. Right now I can't make head nor tail of them:

- stable release drush 7.x-4.5 http://drupal.org/node/1247086 comes from a tag that is on branch 7.x-4.x
- dev release labelled drush-All-versions-5.x-dev comes from the master branch

Furthermore, the project page says to use '7.x', which I assume means 7.x-4.x.

Until there is some actual documentation on this, I'm not changing anything here.

rfay’s picture

Status: Postponed (maintainer needs more info) » Active

The error occurs on the master branch, which is where the latest stuff goes in.

joachim’s picture

Status: Active » Fixed

Hmmm... *eyes narrowing* it still seems all over the place to me.

Anyway, fix committed which version-sniffs drush, as I don't want to break this for people who are downloading the recommended release, which being called 7.x-4.5 I assume is on the 4.x branch. But who knows!

Brownie points if anyone can tell me the proper API-ish way of doing this:

      require_once DRUSH_BASE_PATH . '/commands/pm/download.pm.inc';
      $module_dir = _pm_download_destination('module');

Status: Fixed » Closed (fixed)

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