diff --git a/src/txnupd.cpp b/src/txnupd.cpp index a6da1db..669c92f 100644 --- a/src/txnupd.cpp +++ b/src/txnupd.cpp @@ -115,20 +115,14 @@ static bool setupTransactionalUpdate(PluginHandle * handle) { return true; } - /* Disable SWDB when in transactional update mode, as it - * it currently causes crashes with transactional updates, - * and it is not particularly useful for our case anyway. - */ - if ((handle->transactional_update) || (handle->ext_transactional_update)) { - dnf_context_set_write_history(handle->context, FALSE); - } - /* Check if we're already in a transactional update, possibly * externally invoked by tukit or some other consumer of tukit. * In this scenario, bail early to stop us from attempting to * create a transactional update inside of one in progress. */ if (handle->ext_transactional_update) { + // Disable SWDB in transactional update mode + dnf_context_set_write_history(handle->context, FALSE); auto txnupdsnap_msg = std::string(info.name) + ": " + __func__ + ": Warning: running within transactional update, disabling snapshot handling!"; logger->warning(txnupdsnap_msg); @@ -157,6 +151,12 @@ static bool setupTransactionalUpdate(PluginHandle * handle) { auto transactionRoot = handle->transaction.getRoot(); dnf_context_set_install_root(handle->context, transactionRoot.c_str()); + /* Disable SWDB when in transactional update mode, as it + * it currently causes crashes with transactional updates, + * and it is not particularly useful for our case anyway. + */ + dnf_context_set_write_history(handle->context, FALSE); + /* Mark as being in the transactional update mode, so that * other functions using the handle can do the right thing later. */