Commit 4e9afd1a authored by anarcat's avatar anarcat Committed by anarcat

#597738 - don't install over already installed sites

we do it the proper way, by using site_exists(), not site_installed()
parent d8acce08
......@@ -15,5 +15,7 @@ function drush_provision_mysql_pre_provision_install($url = NULL) {
}
function drush_provision_mysql_pre_provision_install_rollback($url = NULL) {
_provision_mysql_destroy_site_db(drush_get_option('db_name'), drush_get_option('db_user'), drush_get_option('db_passwd'));
if (!_provision_drupal_site_installed($url)) {
_provision_mysql_destroy_site_db(drush_get_option('db_name'), drush_get_option('db_user'), drush_get_option('db_passwd'));
}
}
......@@ -18,8 +18,8 @@ function drush_provision_drupal_provision_install_validate($url) {
if (!$url) {
return drush_set_error("PROVISION_URL_REQUIRED", dt("You need to specify a valid url to install a site"));
}
if (drush_get_option('installed')) {
drush_set_error('PROVISION_SITE_INSTALLED');
if (_provision_drupal_site_exists($url)) {
return drush_set_error('PROVISION_SITE_INSTALLED');
}
}
......@@ -52,12 +52,12 @@ function drush_provision_drupal_provision_install($url) {
* If the install went south, and the site is not PROVISION_SITE_INSTALLED, clean up behind ourselves
*/
function drush_provision_drupal_provision_install_rollback($url) {
if (!drush_cmp_error('PROVISION_SITE_INSTALLED')) {
if ($url) {
if ($url) {
if (!_provision_drupal_site_installed($url)) {
_provision_recursive_delete("sites/$url");
} else {
drush_set_error('PROVISION_FRAMEWORK_ERROR', dt('no url defined in %function', array('%function' => __FUNCTION__)));
}
} else {
drush_set_error('PROVISION_FRAMEWORK_ERROR', dt('no url defined in %function', array('%function' => __FUNCTION__)));
}
}
......
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