From 4fa25d74234da8370c9a5d9f97831e3fa9fa4326 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Feb 19 2021 03:19:40 +0000 Subject: Use a different method to disable multiversion installation Per the recommendations of the DNF team, switch from setting installonly_limit to setting installonlypkgs to effectively disable the multiversion installation behavior. This is done because setting installonly_limit to 1 does not actually do anything, whereas overriding the installonlypkgs configuration to indicate no packages are handled through this mechanism effectively disables the beahvior. Once again, we need to raise the minimum libdnf version to make this work. --- diff --git a/meson.build b/meson.build index 1ffcfa1..2948492 100644 --- a/meson.build +++ b/meson.build @@ -35,7 +35,7 @@ add_project_arguments( language : 'cpp', ) -libdnf = dependency('libdnf', version : '>=0.56') +libdnf = dependency('libdnf', version : '>=0.60') tukit = dependency('tukit', version : '>=3.0.0') libdnf_plugin_src = files( diff --git a/src/txnupd.cpp b/src/txnupd.cpp index 477d1f0..3d87d2b 100644 --- a/src/txnupd.cpp +++ b/src/txnupd.cpp @@ -158,13 +158,13 @@ static bool setupTransactionalUpdate(PluginHandle * handle) { static bool configureTransactionContext(PluginHandle * handle) { auto logger(libdnf::Log::getLogger()); - /* Set installonly_limit to 1 to disable multiversioned kernel installation, + /* 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("installonly_limit", DNF_CONF_PLUGINDEFAULT, "1", NULL)) { - auto instonlylimit_msg = std::string(info.name) + ": " + __func__ + - ": Error: installonly_limit was not successfully overridden!"; - logger->error(instonlylimit_msg); + 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); return false; }