Skip to content

Allow contrib_destination to be managed per project.#582

Merged
jhedstrom merged 1 commit into
drush-ops:masterfrom
fiasco:master
May 29, 2014
Merged

Allow contrib_destination to be managed per project.#582
jhedstrom merged 1 commit into
drush-ops:masterfrom
fiasco:master

Conversation

@fiasco
Copy link
Copy Markdown
Contributor

@fiasco fiasco commented Apr 14, 2014

When defining a Make file, you can't currently control the download contrib destination per project, only globally. This means all module projects are downloaded and restricted to something like "sites/all" by default. If you are using multisite and need to download different modules to different subdirectories, then you can't currently manage that will one drush make call. Likewise, if you want to update modules in a profile, the same issue applies.

This patch amends that be enabling contrib_destination to be controlled per project. However, the project path is still deemed safe through make_safe_path().

@weitzman
Copy link
Copy Markdown
Member

weitzman commented May 9, 2014

@jhedstrom - This look sane to you? This sort of file control over download location does seem to be missing from Make AFAICT.

@jhedstrom
Copy link
Copy Markdown
Member

Would this, in the case of make being called with the no-core option, ignore this and place all projects in one place?

@weitzman
Copy link
Copy Markdown
Member

@fiasco - any comment?

@fiasco
Copy link
Copy Markdown
Contributor Author

fiasco commented May 26, 2014

I tested this with the following Drush make file called build.make:

api = 2
core = 7.x
projects[] = drupal

projects[views][subdir] = "contrib"
projects[ctools][contrib_destination] = "sites/default"
projects[rules][contrib_destination] = "profiles/standard"

First running drush make build.make in an empty directory it downloaded drupal in the root folder and installed all the modules in the correct locations (creating directories as needed). Then running drush make --no-core build.make, the command continued to work as expected and downloaded the projects again to the correct directories:

➜  /tmp/drush-test  find . -name views.module
./sites/all/modules/contrib/views/views.module
➜  /tmp/drush-test  find . -name rules.module
./profiles/standard/modules/rules/rules.module
➜  /tmp/drush-test  find . -name ctools.module
./sites/default/modules/ctools/ctools.module

jhedstrom added a commit that referenced this pull request May 29, 2014
Allow contrib_destination to be managed per project.
@jhedstrom jhedstrom merged commit b49e9cb into drush-ops:master May 29, 2014
@jhedstrom
Copy link
Copy Markdown
Member

Thanks for running those tests. I've tested locally as well and drush make behaves as expected with the --no-core flag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants