On a server where Drush (4.4) has been installed via .deb, drush dl drush_make-6.x-2.2 returns an error:

Destination directory /usr/share/drush/commands is not writable.                                                                                 [error]
Project drush_make (6.x-2.2) could not be downloaded to /usr/share/drush/commands/drush_make.                                                    [error]

Comments

greg.1.anderson’s picture

Category: bug » support
Status: Active » Fixed

This is expected behavior, although perhaps a bit unfortunate. Drush will try to download drush extensions such as drush make to the global commands directory (/usr/share/drush/commads) if it exists. If you do not have write access to this directory, then you will get the error message you reported above.

To get drush to download to some other location, you can either create $HOME/.drush (the per-user location has precedence over the global location), or run drush dl with the --destination option.

ergonlogic’s picture

Thanks for the response.

$HOME/.drush already does exist, actually.

greg.1.anderson’s picture

Title: Drush can't dl into 'commands' directory when installed from .deb » Drush should prefer per-user directory to global directory when later is not writable
Category: support » bug
Status: Fixed » Active
greg.1.anderson’s picture

Assigned: Unassigned » greg.1.anderson
ergonlogic’s picture

StatusFileSize
new690 bytes

I *think* just adding a is_writable($install_dir) in pm_drush_pm_download_destination_alter() fixes this.

greg.1.anderson’s picture

Status: Active » Reviewed & tested by the community

Your patch is rolled backwards, but yes, that is exactly right.

ergonlogic’s picture

StatusFileSize
new690 bytes

Gah! Sorry about that. Rerolled.

greg.1.anderson’s picture

Status: Reviewed & tested by the community » Fixed

Committed.

Status: Fixed » Closed (fixed)

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

ergonlogic’s picture

Version: 7.x-4.4 » All-versions-4.x-dev
Status: Closed (fixed) » Patch (to be ported)

This should be feasible to backport to the 4.x branch, no?

Also, I know it's a very small patch, but is there any way I could get author attribution (--author="ergonlogic ")?

greg.1.anderson’s picture

I know how to do that on commit, and I'm sorry I forgot. If you know the git amend command to do it retroactively, I'll do it. Can a commit be amended when it is no longer at HEAD?

moshe weitzman’s picture

You can't amend pushed commits on drupal.org. It would break people's clones.

moshe weitzman’s picture

I should add that if you use git format-patch as advocated at http://drupal.org/node/1054616, then your attribution comes along with the patch.

ergonlogic’s picture

Thank you both. No worries for the current patch :) I'll try to use 'git format-patch' in the future.

And on the subject of a backport to 4.x? Is there something I can do to help?

greg.1.anderson’s picture

You could check to see if your patch applied cleanly to 7.x-4.x, and re-roll if it does not.

ergonlogic’s picture

StatusFileSize
new1.13 KB

I had rolled the patch in #7 from within the commands/pm/ directory. Here's one rolled from the drush root, and using 'git format-patch' as moshe suggested.

ergonlogic’s picture

Status: Patch (to be ported) » Needs review
greg.1.anderson’s picture

Status: Needs review » Fixed

Committed; thanks.

Status: Fixed » Closed (fixed)

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