diff --git a/db_server/install.provision.inc b/db_server/install.provision.inc index 7c48ed2897aa899d5d881a3e66508cc4358c3b08..686c88b8079cc13168757a9cea297f87a00dbe9a 100644 --- a/db_server/install.provision.inc +++ b/db_server/install.provision.inc @@ -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')); + } } diff --git a/platform/install.provision.inc b/platform/install.provision.inc index f8fd7d8e436e0f4603cfbc71d12e690576b7953c..abc6b218ebb24f5471d4a269f1b62788a866f168 100644 --- a/platform/install.provision.inc +++ b/platform/install.provision.inc @@ -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__))); } }