diff --git a/apps.installer.inc b/apps.installer.inc index f44fb43..9590694 100755 --- a/apps.installer.inc +++ b/apps.installer.inc @@ -26,6 +26,7 @@ function apps_download_apps($app) { $downloads[$key]['url'] = $app['downloadables'][$key]; // do a quick dirty pull of the name from the key $downloads[$key]['name'] = ($e = strpos($key, " ")) ? substr($key, 0, $e) : $key; + $downloads[$key]['type'] = isset($app['libraries']) && in_array($key, $app['libraries']) ? 'library' : 'module'; } $download_commands = array(); $install_commands = array(); @@ -34,7 +35,8 @@ function apps_download_apps($app) { 'apps_download_batch', array( $download['name'], - $download['url'] + $download['url'], + $download['type'], ), ); } @@ -67,7 +69,7 @@ function apps_download_batch_finished($success, $results) { * we need this becuase in a batch set the file param is for bouth the operations as well * as the other callbackes */ -function apps_download_batch($project, $url, &$context) { +function apps_download_batch($project, $url, $type, &$context) { //$args = func_get_args(); module_load_include("inc", "update", "update.manager"); //return call_user_func_array('update_manager_batch_project_get', $args); @@ -88,6 +90,10 @@ function apps_download_batch($project, $url, &$context) { // Extract it. $extract_directory = _update_manager_extract_directory(); + + //add the type to the path to prevent conflicts + $extract_directory = $extract_directory . '/' . $type; + try { update_manager_archive_extract($local_cache, $extract_directory); }