Skip to content

Commit

Permalink
Merge branch 'pr/1065'
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Jan 17, 2015
2 parents 2a0f336 + 719ece0 commit c400d5e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
14 changes: 8 additions & 6 deletions commands/pm/package_handler/wget.inc
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ function package_handler_download_project(&$request, $release) {
}

// Check Md5 hash.
if (drush_op('md5_file', $download_path) != $release['mdhash'] && !drush_get_context('DRUSH_SIMULATE')) {
drush_delete_dir(drush_download_file_name($download_link, TRUE));
return drush_set_error('DRUSH_PM_FILE_CORRUPT', dt('File !filename is corrupt (wrong md5 checksum).', array('!filename' => $filename)));
}
else {
drush_log(dt('Md5 checksum of !filename verified.', array('!filename' => $filename)));
if (!drush_get_option('no-md5')) {
if (drush_op('md5_file', $download_path) != $release['mdhash'] && !drush_get_context('DRUSH_SIMULATE')) {
drush_delete_dir(drush_download_file_name($download_link, TRUE));
return drush_set_error('DRUSH_PM_FILE_CORRUPT', dt('File !filename is corrupt (wrong md5 checksum).', array('!filename' => $filename)));
}
else {
drush_log(dt('Md5 checksum of !filename verified.', array('!filename' => $filename)));
}
}

// Extract the tarball in place and return the full path to the untarred directory.
Expand Down
3 changes: 3 additions & 0 deletions commands/pm/pm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1680,6 +1680,9 @@ function pm_drush_engine_package_handler() {
return array(
'wget' => array(
'description' => 'Download project packages using wget or curl.',
'options' => array(
'no-md5' => 'Skip md5 validation of downloads.',
),
),
'git_drupalorg' => array(
'description' => 'Use git.drupal.org to checkout and update projects.',
Expand Down

0 comments on commit c400d5e

Please sign in to comment.