fails to download install profile in proper location. Incorrect path. Patch.

anarcat - June 23, 2009 - 23:15
Project:Drush
Version:All-Versions-2.0
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

That one looks pretty weird from the outside:

aegir@ceres:~/drupal-6.12/profiles$ drush dl single_user_blog
Project single_user_blog (6.x-1.x-dev) downloaded to                 [success]
/var/aegir/drupal-6.12profiles/.

I would have expected the install profile to be deployed in /var/aegir/drupal-6.12/profiles/single_user_blog. Instead it is in ~/drupal-6.12profiles/single_user_blog, pretty weird.

#1

dman - July 29, 2009 - 03:17
Title:fails to download install profile in proper location» fails to download install profile in proper location. Incorrect path. Patch.
Status:active» needs review

Indeed.
I got the same.
Here's the simple fix.
Before:

<?php
/**
* Determine a candidate destination directory for a particular site path and
* return it if it exists, optionally attempting to create the directory.
*/
function pm_dl_destination_lookup($type, $drupal_root, $sitepath, $create = FALSE) {
  switch (
$type) {
    case
'module':
     
$destination = $sitepath . 'modules/';
      break;
    case
'theme':
     
$destination = $sitepath . 'themes/';
      break;
    case
'theme engine':
     
$destination = $sitepath . 'themes/engines/';
      break;
    case
'translation':
     
$destination = $drupal_root . '/';
      break;
    case
'profile':
     
$destination = $drupal_root . 'profiles/';
      break;
  }
  if (
$create) {
   
drush_log(dt('Attempting to create destination directory at !dir', array('!dir' => $destination)));
    @
drush_op('mkdir', $destination, 0777, TRUE);
  }
  if (
is_dir($destination)) {
   
drush_log(dt('Using destination directory !dir', array('!dir' => $destination)));
    return
$destination;
  }
 
drush_log(dt('Could not find destination directory at !dir', array('!dir' => $destination)));
  return
FALSE;
}
?>

after:
    case 'profile':
      $destination = $drupal_root . '/profiles/';
      break;

drupal_root has no trailing slash;
Works for me (when running in the sites/sitename dir, and using CVS dl method)

AttachmentSize
drush-incorrect_install_path_for_dl_profiles.patch 652 bytes

#2

anarcat - July 30, 2009 - 19:48
Status:needs review» fixed

This was committed in http://drupal.org/cvs?commit=244222.

#3

System Message - August 13, 2009 - 19:50
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.