Currently the "drush make" command automatically unpacks downloaded files when it detects that the file is a supported archive format. While this is a very handy feature, it is not always the desired behavior. In our case we want to download a Java JAR-file
to make it available in the build. As JAR files are essentially ZIP Archives with a predefined directory structure, drush unpacks
the archive which makes it unusable. I guess this would also affect PHAR archives as well.
So instead of extending the filetype determination I would suggest to add an optional parameter to prevent the automatic unpacking. This will not break the current behavior.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | flag_to_prevent_automatic_unpack-1788908-7.patch | 2.28 KB | nmandery |
| #1 | flag_to_prevent_automatic_unpack-1788908-1.patch | 2.28 KB | nmandery |
Comments
Comment #1
nmandery commentedThe attached patch implements optional "unpack" flag.
Comment #2
jhedstromI'll try to review soon. Can you provide a publicly available example we could build a test from?
Comment #3
nmandery commentedYou may use the branch 7.x-dont-unpack-jar of the cartaro project as an example.
The relevant commit is this one:
http://drupalcode.org/project/cartaro.git/commit/80227b34812503fe01ad1ea...
Comment #4
jhedstromMarked #1570934: Allow for archives to remain packed as a duplicate.
Comment #5
friedjoff commentedI've been using the above patch and everything looks good to me.
Looking forward to get this committed and deployed on drupal.org, so my distribution makefile can take use of it.
Comment #6
jonhattan$unpack is TRUE if $download['unpack'] is 'false'? It seems wrong to me.
Comment #7
nmandery commentedYou are right - I messed up the comparison. The flag should be compared to "true" instead of "false".
I attached the new version of the patch to this reply.
Comment #8
friedjoff commentedLooks good now.
Comment #9
jhedstromComment #10
jhedstromI'm seeing a failure with this patch:
Comment #11
joestewart commentedI did not have the test failure noted in #10, but the patch didn't seem to work for me when using the unpack option to disable unpacking.
This ternary still doesn't seem right.
Would it be better to use yes/no instead of true/false?
Then just pass it on to make_download_file_unpack() and check the unpack value there?
Isn't a drush_get_option('unpack') needed here?
Also doesn't there need to be an array entry in make_drush_command to allow the unpack commandline option?
Comment #12
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If this feature is still desired, you may copy it to our Github project. For best results, create a Pull Request that has been updated for the master branch. Post a link here to the PR, and please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.