Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package libdnf-plugin-txnupd for
openSUSE:Factory checked in at 2021-03-06 21:18:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/libdnf-plugin-txnupd (Old)
and /work/SRC/openSUSE:Factory/.libdnf-plugin-txnupd.new.2378 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libdnf-plugin-txnupd"
Sat Mar 6 21:18:40 2021 rev:3 rq:877295 version:0.1.2
Changes:
--------
---
/work/SRC/openSUSE:Factory/libdnf-plugin-txnupd/libdnf-plugin-txnupd.changes
2021-02-25 18:29:47.686272354 +0100
+++
/work/SRC/openSUSE:Factory/.libdnf-plugin-txnupd.new.2378/libdnf-plugin-txnupd.changes
2021-03-06 21:18:40.689238909 +0100
@@ -1,0 +2,17 @@
+Fri Mar 5 19:50:03 UTC 2021 - Neal Gompa <[email protected]>
+
+- Update to 0.1.2
+ + Add handling for externally invoked transactional updates
+
+-------------------------------------------------------------------
+Thu Mar 4 13:44:04 UTC 2021 - Neal Gompa <[email protected]>
+
+- Update to 0.1.1
+ + Disable protection of the running kernel in transactions
+
+-------------------------------------------------------------------
+Tue Mar 2 04:02:59 UTC 2021 - Neal Gompa <[email protected]>
+
+- Update libdnf build dependency to require 0.60+
+
+-------------------------------------------------------------------
Old:
----
libdnf-plugin-txnupd-0.1.0.tar.gz
New:
----
libdnf-plugin-txnupd-0.1.2.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ libdnf-plugin-txnupd.spec ++++++
--- /var/tmp/diff_new_pack.aw8OcA/_old 2021-03-06 21:18:41.133239364 +0100
+++ /var/tmp/diff_new_pack.aw8OcA/_new 2021-03-06 21:18:41.133239364 +0100
@@ -17,7 +17,7 @@
Name: libdnf-plugin-txnupd
-Version: 0.1.0
+Version: 0.1.2
Release: 0
Summary: Plugin for libdnf to implement transactional updates
License: LGPL-2.1-or-later
@@ -35,7 +35,7 @@
BuildRequires: gcc-c++ >= 10
%endif
-BuildRequires: pkgconfig(libdnf) >= 0.58
+BuildRequires: pkgconfig(libdnf) >= 0.60
BuildRequires: pkgconfig(tukit) >= 3.1.2
# To keep OBS and rpmlint from complaining about directory ownership
@@ -67,9 +67,6 @@
%prep
%autosetup -p1
-# Fix libdnf dependency for openSUSE to account for backported fixes
-sed -e "s/'libdnf', version : '>=0.60'/'libdnf', version : '>=0.58'/" -i
meson.build
-
%build
%if 0%{?suse_version} && 0%{?suse_version} < 1550
++++++ libdnf-plugin-txnupd-0.1.0.tar.gz -> libdnf-plugin-txnupd-0.1.2.tar.gz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libdnf-plugin-txnupd-0.1.0/meson.build
new/libdnf-plugin-txnupd-0.1.2/meson.build
--- old/libdnf-plugin-txnupd-0.1.0/meson.build 2021-02-19 04:19:40.000000000
+0100
+++ new/libdnf-plugin-txnupd-0.1.2/meson.build 2021-03-05 20:36:59.000000000
+0100
@@ -1,5 +1,5 @@
project('libdnf-plugin-txnupd', 'cpp',
- version : '0.1.0',
+ version : '0.1.2',
license : 'LGPL-2.1-or-later',
default_options : [
'buildtype=debugoptimized',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/libdnf-plugin-txnupd-0.1.0/src/txnupd.cpp
new/libdnf-plugin-txnupd-0.1.2/src/txnupd.cpp
--- old/libdnf-plugin-txnupd-0.1.0/src/txnupd.cpp 2021-02-19
04:19:40.000000000 +0100
+++ new/libdnf-plugin-txnupd-0.1.2/src/txnupd.cpp 2021-03-05
20:36:59.000000000 +0100
@@ -14,6 +14,7 @@
*/
// Standard library includes
+#include <cstdlib>
#include <filesystem>
#include <string>
@@ -39,8 +40,9 @@
// Pointer to instance of this structure is returned by pluginInitHandle() as
handle.
struct _PluginHandle {
PluginMode mode;
- DnfContext * context; // store plugin context
specific init data
- bool transactional_update; // flag to determine if
doing a transactional update
+ DnfContext * context; // store plugin context
specific init data
+ bool transactional_update; // flag to determine if
doing a transactional update
+ bool ext_transactional_update; // flag to determine if
within an existing transactional update
TransactionalUpdate::Transaction transaction{}; // transactional update
object
};
@@ -54,26 +56,27 @@
PluginHandle * pluginInitHandle(int version, PluginMode mode,
DnfPluginInitData * initData) {
auto logger(libdnf::Log::getLogger());
if (version != 1) {
- auto msg = std::string(info.name) + ": " + __func__ + ": Error:
Unsupported API version";
- logger->error(msg);
- return nullptr;
+ auto msg = std::string(info.name) + ": " + __func__ + ": Error:
Unsupported API version";
+ logger->error(msg);
+ return nullptr;
}
if (mode != PLUGIN_MODE_CONTEXT) {
- auto msg = std::string(info.name) + ": " + __func__ + ": Warning:
Unsupported mode";
- logger->warning(msg);
- return nullptr;
+ auto msg = std::string(info.name) + ": " + __func__ + ": Warning:
Unsupported mode";
+ logger->warning(msg);
+ return nullptr;
}
auto handle = new PluginHandle;
handle->mode = mode;
handle->context = pluginGetContext(initData);
handle->transactional_update = false;
+ handle->ext_transactional_update = (std::getenv("TRANSACTIONAL_UPDATE") !=
NULL);
return handle;
}
// Destroys the plugin instance identified by given handle.
void pluginFreeHandle(PluginHandle * handle) {
if (handle)
- delete handle;
+ delete handle;
}
@@ -94,10 +97,10 @@
*/
const std::string installRoot =
dnf_context_get_install_root(handle->context);
if (!installRoot.empty() && installRoot.compare("/") != 0) {
- auto instroot_msg =
- std::string(info.name) + ": " + __func__ + ": Warning: Using
installroot, disabling transactional-update!";
- logger->warning(instroot_msg);
- return true;
+ auto instroot_msg =
+ std::string(info.name) + ": " + __func__ + ": Warning: Using
installroot, disabling transactional-update!";
+ logger->warning(instroot_msg);
+ return true;
}
/* Also, all of the transactional-update stuff only works as root.
@@ -106,10 +109,30 @@
* as non-root.
*/
if (getuid() != 0) {
- auto rootuid_msg = std::string(info.name) + ": " + __func__ +
- ": Warning: operating as non-root, disabling
transactional-update!";
- logger->warning(rootuid_msg);
- return true;
+ auto rootuid_msg = std::string(info.name) + ": " + __func__ +
+ ": Warning: operating as non-root, disabling
transactional-update!";
+ logger->warning(rootuid_msg);
+ 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) {
+ auto txnupdsnap_msg = std::string(info.name) + ": " + __func__ +
+ ": Warning: running within transactional update,
disabling snapshot handling!";
+ logger->warning(txnupdsnap_msg);
+ return true;
}
/* Now that we've gotten the basic early-bail conditions handled,
@@ -122,23 +145,18 @@
* we try to proceed any further.
*/
if (!(handle->transaction.isInitialized())) {
- auto txnfail_msg =
- std::string(info.name) + ": " + __func__ + ": Error: failed to
initialize transactional update!";
- logger->error(txnfail_msg);
- return false;
+ auto txnfail_msg =
+ std::string(info.name) + ": " + __func__ + ": Error: failed to
initialize transactional update!";
+ logger->error(txnfail_msg);
+ return false;
}
auto txnupd_snapid_msg =
- std::string(info.name) + ": " + __func__ + ": Info: Created snapshot ID
" + handle->transaction.getSnapshot();
+ std::string(info.name) + ": " + __func__ + ": Info: Created snapshot
ID " + handle->transaction.getSnapshot();
logger->debug(txnupd_snapid_msg);
auto transactionRoot = handle->transaction.getRoot();
dnf_context_set_install_root(handle->context, transactionRoot.c_str());
- /* Disable SWDB as 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.
*/
@@ -158,13 +176,33 @@
static bool configureTransactionContext(PluginHandle * handle) {
auto logger(libdnf::Log::getLogger());
+ /* Check to see if we are actually in transactional update mode,
+ * and bail out early if we are not.
+ */
+ if ((!(handle->transactional_update)) &&
(!(handle->ext_transactional_update))) {
+ auto txnupd_msg =
+ std::string(info.name) + ": " + __func__ + ": Warning: Not a
transactional update, so doing nothing!";
+ logger->warning(txnupd_msg);
+ return true;
+ }
+
/* Set installonlypkgs to nothing to disable multiversioned kernel
installation,
* as we need it disabled for this type of transaction.
*/
if (!dnf_conf_main_set_option("installonlypkgs", DNF_CONF_PLUGINDEFAULT,
"", NULL)) {
- auto instonlypkgs_msg = std::string(info.name) + ": " + __func__ +
- ": Error: installonlypkgs was not successfully
overridden!";
- logger->error(instonlypkgs_msg);
+ auto instonlypkgs_msg =
+ std::string(info.name) + ": " + __func__ + ": Error:
installonlypkgs was not successfully overridden!";
+ logger->error(instonlypkgs_msg);
+ return false;
+ }
+
+ /* Disable protection of the running kernel, as this type of transaction
never
+ * impacts the running system and it could misguidedly stop upgrades.
+ */
+ if (!dnf_conf_main_set_option("protect_running_kernel",
DNF_CONF_PLUGINDEFAULT, "0", NULL)) {
+ auto protectkernel_msg =
+ std::string(info.name) + ": " + __func__ + ": Error:
protect_running_kernel was not successfully disabled!";
+ logger->error(protectkernel_msg);
return false;
}
@@ -186,10 +224,10 @@
* and bail out early if we are not.
*/
if (!(handle->transactional_update)) {
- auto txnupd_msg =
- std::string(info.name) + ": " + __func__ + ": Warning: Not a
transactional update, so doing nothing!";
- logger->warning(txnupd_msg);
- return true;
+ auto txnupd_msg =
+ std::string(info.name) + ": " + __func__ + ": Warning: Not a
transactional update, so doing nothing!";
+ logger->warning(txnupd_msg);
+ return true;
}
/* Finally, complete the transaction and finalize
@@ -203,17 +241,17 @@
// The plugin "main loop"
int pluginHook(PluginHandle * handle, PluginHookId id, DnfPluginHookData *
hookData, DnfPluginError * error) {
if (!handle)
- return 1;
+ return 1;
switch (id) {
- case PLUGIN_HOOK_ID_CONTEXT_PRE_REPOS_RELOAD:
- return setupTransactionalUpdate(handle);
- case PLUGIN_HOOK_ID_CONTEXT_CONF:
- return configureTransactionContext(handle);
- case PLUGIN_HOOK_ID_CONTEXT_TRANSACTION:
- return completeTransactionalUpdate(handle);
- default:
- break;
+ case PLUGIN_HOOK_ID_CONTEXT_PRE_REPOS_RELOAD:
+ return setupTransactionalUpdate(handle);
+ case PLUGIN_HOOK_ID_CONTEXT_CONF:
+ return configureTransactionContext(handle);
+ case PLUGIN_HOOK_ID_CONTEXT_TRANSACTION:
+ return completeTransactionalUpdate(handle);
+ default:
+ break;
}
return 1;
}