Commit 1cda2beb authored by ergonlogic's avatar ergonlogic Committed by Aegir user

Issue #2650290: Search for packages in D8 profiles under subdirs.

parent 1711e18f
......@@ -243,3 +243,25 @@ function _provision_find_profiles() {
}
return $profiles;
}
/**
* Retrieve a list of paths to search in a certain scope
*/
function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
$searchpaths = array();
$drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
switch ($scope) {
case 'base' :
$searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
$searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
break;
default :
if ($key) {
$searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
}
break;
}
return $searchpaths;
}
......@@ -260,3 +260,25 @@ function _provision_find_profiles() {
}
return $profiles;
}
/**
* Retrieve a list of paths to search in a certain scope
*/
function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
$searchpaths = array();
$drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
switch ($scope) {
case 'base' :
$searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
$searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
break;
default :
if ($key) {
$searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
}
break;
}
return $searchpaths;
}
......@@ -135,10 +135,10 @@ function _provision_find_profiles() {
$profile->name = $info['name'];
$profile->info = $info;
$profile->filename = $path;
$profile_path = dirname($path);
$profile->info['languages'] = _provision_find_profile_languages($profile_path);
$profile->path = dirname($path);
$profile->info['languages'] = _provision_find_profile_languages($profile->path);
$profiles[basename($profile_path)] = $profile;
$profiles[basename($profile->path)] = $profile;
drush_log(dt('Found install profile %name', array('%name' => $name)));
}
}
......@@ -146,3 +146,30 @@ function _provision_find_profiles() {
return $profiles;
}
/**
* Retrieve a list of paths to search in a certain scope
*/
function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
$searchpaths = array();
$drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
switch ($scope) {
case 'base':
$searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
$searchpaths[] = sprintf("%s/core/%s", $drupal_root, $type);
$searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
break;
case 'profiles':
foreach (_provision_find_profiles() as $profile) {
$searchpaths[] = $profile->path;
}
break;
default:
if ($key) {
$searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
}
break;
}
return $searchpaths;
}
......@@ -541,28 +541,6 @@ function provision_drupal_system_map() {
return _provision_drupal_system_map();
}
/**
* Retrieve a list of paths to search in a certain scope
*/
function _provision_drupal_search_paths($scope, $key = '', $type = 'modules') {
$searchpaths = array();
$drupal_root = drush_get_context('DRUSH_DRUPAL_ROOT');
switch ($scope) {
case 'base' :
$searchpaths[] = sprintf("%s/%s", $drupal_root, $type);
$searchpaths[] = sprintf("%s/core/%s", $drupal_root, $type);
$searchpaths[] = sprintf("%s/sites/all/%s", $drupal_root, $type);
break;
default :
if ($key) {
$searchpaths[] = sprintf("%s/%s/%s/%s", $drupal_root, $scope, $key, $type);
}
break;
}
return $searchpaths;
}
/**
* Find modules in a certain scope.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment