Closed (won't fix)
Project:
Drush
Version:
8.x-6.x-dev
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
17 Nov 2012 at 04:22 UTC
Updated:
11 Sep 2013 at 05:18 UTC
I copied and modified package_handler_download_project(), so I may be responsible and I cannot give an easy way to reproduce the problem. That said, let's look at the code:
These lines (take out of context, but the control flow is preserved) remove the 0 key from the return value:
function drush_tarball_extract($path, $destination = FALSE, $listing = FALSE) {
if (($mimetype == 'application/zip') || ($mimetype == 'application/x-zip')) {
if ($listing) {
$output = drush_shell_exec_output();
array_shift($output);
$return = array_filter($output, create_function('$str', 'return $str != "";'));
return $return;
Then these lines from drush/commands/pm/package_handler/wget.inc try to fetch that key:
function package_handler_download_project(&$request, $release) {
$file_list = drush_tarball_extract($path, $request['base_project_path'], TRUE);
$project_dir = drush_trim_path($file_list[0]);
It looks to me as though array_shift($file_list) would do a better job than $file_list[0].
Comments
Comment #1
jonhattanI don't understand which is the bug report here.
package_handler/wget.incworks with tgz files, not zip files. Are you implementing a .zip variant?Comment #2
benjifisher@jonhattan:
Maybe I am confused, but bear with me. I see that there are two versions of
package_handler_download_project(), one inpackage_handler/git_drupalorg.incand one inpackage_handler/wget.inc. The one inwget.inc, as far as I can tell, does not deal directly with wget nor with tgz files: it callsdrush_download_file()to use cache, wget, curl, or file_get_contents; and it callsdrush_tarball_extract()to deal with archives. The archive might be a tar file or a zip file.Here are the first 33 lines of
drush_tarball_extract(), with nothing skipped. I did not write this!The lines I quoted in the issue summary are all there, and I am pretty sure that the ones I skipped do not change the control flow.
Background: I want to download some zip files from GitHub. Since GitHub uses
https://and some systems (like my own) have broken installations of wget, I want to call wget with the--no-check-certificateoption. So I copied and pasted_drush_download_file()and edited it. That is why I cannot give an easy example to reproduce the bug. I calleddrush_tarball_extract(), not a custom version of this function.Comment #3
greg.1.anderson commentedThis issue was marked
closed (won't fix)because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate).Please ask support questions on Drupal Answers.