Closed (duplicate)
Project:
Drush
Component:
Make
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
14 Sep 2010 at 23:12 UTC
Updated:
7 Jul 2012 at 16:37 UTC
Jump to comment: Most recent file
It would be very useful to have a way of defining a default path for projects and libraries, e.g.:
paths[projects] = "sites/all/module/contrib"
paths[projects][theme] = "sites/all/themes"
paths[libraries] = "sites/all/libraries"
Right now the only way of doing this globally is the --contrib-destination argument; this has to be manually assigned every time "drush make" is executed, which is a pain & not very workflow-friendly.
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | drush-make-default-project-path-911722-5473410.patch | 2.52 KB | boztek |
| #34 | drush-default-project-path-911722-3925286.patch | 2.09 KB | boztek |
Comments
Comment #1
damienmckennaCorrection, the --contrib-destination argument moves *all* downloads to the specified directory by default, so the only way of doing it right now it to manually specify the [subdir] argument for all projects. Ew.
Comment #2
rjmackay commentedsubscribing
Comment #3
dmitrig01 commented#913148: Please bring back install_path
Comment #4
damienmckennaThe other issue is not strictly the same as this request, so this ticket is being reopened.
Comment #5
dmitrig01 commentedwhoops, you're right.
In the .ini format, which .info is based off of, you have something like this.
Which would be able to very nicely solve our problem. However, that format's not really an option. THe only thing that comes to mind is some sort of hack like
for which we'd need to re-write the .info parser anyway, but a hack is a hack. The really tricky thing is we run into issues like this one:
where do we put foo? under contrib or custom?
Comment #6
guddomeNt commentedThe syntax doesn't really cater for it currently, but I think it would be helpful to somehow use a scope for this, rather than a global setting. Eg. semantically something like:
I realise that this will derive the syntax from .info files, so I'm not sure if the trade is worth it.
Comment #7
dmitrig01 commentedI think changing the syntax is fine - but again, you'd run into the problem I had in comment #5.
But, we could do something like this as a shortcut:
Comment #8
dmitrig01 commentedA side note, while we're talking about this - it'd be great if there was a more concise array notation, f.e.
Or extrapolated to
Though, that's not very pretty - but, while we're looking at enhancing the syntax, I'd like to consider something like this.
Comment #9
damienmckennaAn alternative method of handling this would be to just add an option to create the "sites/all/modules/contrib" directory, because if it exists then Drush automatically downloads modules to there.
Comment #10
dmitrig01 commentedyes, though drush make doesn't use drush dl's logic, and as such doesn't automatically download to sites/all/modules/contrib
Comment #11
damienmckenna@dmitrig01: .. maybe it should where appropriate, e.g. this case?
Comment #12
guddomeNt commentedI'm not sure I understand what you mean by ".. the problem I had in comment #5 .."?
Consider this:
Which would be semantically synonymous with this:
Since "baz" is outside the scope, it isn't affected by the "subdir" setting. No need for any parenthesis there.
Note that I don't particularly like the syntax I proposed. Perhaps something like this would be more elegant:
Comment #13
dmitrig01 commentedYep. To recap, my syntax:
Which is the same as
I prefer my syntax because:
1. The scope { syntax is confusing, because you're doin a lot of hardcoding in there, and what if someone were to write this?
2. The second, almost YAML-like format is also not preferable IMO because first, it falls under the same problem as #1, and 2, an .info/.ini-based format is closer to what most people are familiar with (as in, PHP) - [] is used for arrays, and {} is used for nesting. The parenthesis in my example is similar to a function declaration, but it declares specifically _what_ the scope is.
It's also easily nestable:
should be fairly understandable - both foo and bar have subdir = contrib, but only bar has the modified location = code.developmentseed.org...
Comment #14
dmitrig01 commentedAlso, when I referred to comment #5, I meant the following problem.
Using your syntax:
Now, under what subdir does projects[foo] fall (yes, one could say either the first or last, but how will most people who don't rtfm know)? However, I've since realized that we probably could just throw an error in this situation (i.e., setting attributes in different scopes). So, disregard that issue, and let's continue discussing the syntax itself - I'd like to hear any cons you have about my syntax.
Comment #15
damienmckennaAn alternative syntax idea.
The key rationale for suggesting this was to avoid adding more syntax hacks.
Comment #16
dmitrig01 commentedThat is an interesting idea, but I see two problems with this:
The first is that it needs the hardcoded of "subdir means this inherits, project means it doesn't inherit", etc - what if we introduce a new property? Do we have to update the index of inheritable properties?
Also, a lesser problem, what if you wanted something to go in sites/all/modules/default?
To me, this solution seems to be a bit less elegant - it seems simply to try to massage the existing syntax into something that could work, but to me, just doesn't feel completely "correct."
What do you think of the syntax in #13 - would that work? What I like about it is that a makes a distinction between properties that should be set (those are in the parenthesis) and info definitions themselves (which stay the same).
Comment #17
damienmckenna@dmitrig01: you make valid points. Could the syntax from #13 be done without the extra brackets, e.g.:
Comment #18
dmitrig01 commentedsure. i just thought it made it a little bit easier to read and separated out, especially with multiple:
Comment #19
damienmckennaMaybe make the parenthesis required for multiple terms but have it optional for single terms?
Comment #20
dmitrig01 commentedMaybe. but that still could create some confusion if written oddly
Not to mention that it would be easier for a parser if it had ().
Comment #21
dmitrig01 commented[edit: double post]
Comment #22
dmitrig01 commentedAlso of note: my proposed format (especially as opposed to #12) is fully backwards-compatible
Comment #23
dmitrig01 commentedI'm going to mark this "postponed" as this is something I'd like to see in 3.x, but to get 2.0 out the door I don't think writing a new grammar parser is feasible.
Comment #24
dmitrig01 commentedHowever, let's continue the discussion - I am looking forward to implementing this and we might as well straighten out all the details beforehand.
Comment #25
winston commentedNot 100% sure this is related, but fishing through the issue queue led me here.
I would like to be able to download files using drush make as well. For example download an archive an have it placed in a files folder (or some other arbitrary folder either under sites or under the drupal root).
In my specific use case this would be to provide demo snapshots, but I could foresee other uses.
Comment #26
simeFeels like some of the ideas are over-worked and the syntax being suggested seriously reduces the readability of the make file (one of the makefile's strengths IMO). There is no additional functionality being introduced here, just the desire to simplify the make file and make it more readable and maintainable.
Alternatively, the OP raises the idea of a generic solution for setting default arguments (which can be overridden on CLI):
Comment #27
dmitrig01 commentedComment #29
damienmckennaWas this closed prematurely, or is there another way of doing this? Thanks.
Comment #30
dtwork commentedcan 'fixed' be further explained? what's the solution?
Comment #31
dtwork commentedComment #32
dtwork commentedComment #33
helmo commented[ Powered by #1115636: Issue Macros and Templates - Drush Make]
Drush make is being merged into drush core (discussed in issue:#1310130: Put drush make in drush core)
This means that the issue queue is also moving. The drush queue has a component 'Make' especially for drush_make.
More information will be posted on the drush_make and drush project pages.
NOTE: related: #1337468: --contrib-destination adds folder like modules or themes
Comment #34
boztek commentedI agree a simple solution where a default can be set either as a command line option or in a defaults array would be a useful first step.
Here is a patch with both a 'default-subdir' option and a defaults[subdir] make file option as sketched by sime in #26.
Comment #35
boztek commentedUpdated comment.
Comment #36
dmitrig01 commentedSorry, what I meant when I fixed this issue was I fixed it in the 3.x version, using notation similar to what I outlined in #13, with all kinds of additional crazyness. However, that was not ported to Drush core -- only 2.x was. So this functionality got lost in 'the void'. I don't have time to port this forward, but if someone would like to take it up, I think it shouldn't be too difficult but it would be a major improvement.
Comment #37
moshe weitzman commentedIt is possible that this lower priority now that we are integrated with pm-download. please add current summary if needed.
Comment #38
jonhattanAnother solution was recently commited in #1633050: Create defaults array in .make files for specifying attributes common to all projects. So marking this as duplicate. Reopen for further discussion.
The approach is simpler than proposals in this issue: