Skip to content

Commit 1808734

Browse files
committed
upgrade: add experimental option to reset overrides
experimental ex-reset-overrides option allows resetting overrides before upgrading Signed-off-by: Rafael G. Ruiz <llerrak@hotmail.com>
1 parent e1861fe commit 1808734

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/app/rpmostree-builtin-upgrade.cxx

+3
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static gboolean opt_download_only;
4343
static char *opt_automatic;
4444
static gboolean opt_lock_finalization;
4545
static gboolean opt_bypass_driver;
46+
static gboolean opt_ex_reset_overrides;
4647

4748
/* "check-diff" is deprecated, replaced by "preview" */
4849
static GOptionEntry option_entries[] = {
@@ -60,6 +61,7 @@ static GOptionEntry option_entries[] = {
6061
{ "trigger-automatic-update-policy", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &opt_automatic, "For automated use only; triggered by automatic timer", NULL },
6162
{ "lock-finalization", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &opt_lock_finalization, "Prevent automatic deployment finalization on shutdown", NULL },
6263
{ "bypass-driver", 0, 0, G_OPTION_ARG_NONE, &opt_bypass_driver, "Force an upgrade even if an updates driver is registered", NULL},
64+
{ "ex-reset-overrides", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &opt_ex_reset_overrides, "Reset overrides before upgrade", NULL },
6365
{ NULL }
6466
};
6567

@@ -174,6 +176,7 @@ rpmostree_builtin_upgrade (int argc,
174176
g_variant_dict_insert (&dict, "download-only", "b", opt_download_only);
175177
g_variant_dict_insert (&dict, "lock-finalization", "b", opt_lock_finalization);
176178
g_variant_dict_insert (&dict, "initiating-command-line", "s", invocation->command_line);
179+
g_variant_dict_insert (&dict, "ex-reset-overrides", "b", opt_ex_reset_overrides);
177180
g_autoptr(GVariant) options = g_variant_ref_sink (g_variant_dict_end (&dict));
178181

179182
/* Use newer D-Bus API only if we have to. */

src/daemon/rpmostreed-transaction-types.cxx

+3-3
Original file line numberDiff line numberDiff line change
@@ -1342,8 +1342,8 @@ deploy_transaction_execute (RpmostreedTransaction *transaction,
13421342
return FALSE;
13431343
}
13441344
}
1345-
1346-
if (no_overrides)
1345+
const gboolean ex_reset_overrides = vardict_lookup_bool (self->options, "ex-reset-overrides", FALSE);
1346+
if (no_overrides || (is_upgrade && ex_reset_overrides))
13471347
{
13481348
if (!rpmostree_origin_remove_all_overrides (origin, &changed, error))
13491349
return FALSE;
@@ -1440,7 +1440,7 @@ deploy_transaction_execute (RpmostreedTransaction *transaction,
14401440
if (override_replace_local_pkgs)
14411441
{
14421442
g_autoptr(GPtrArray) pkgs = NULL;
1443-
if (!import_many_local_rpms (repo, override_replace_local_pkgs, &pkgs,
1443+
if (!import_many_local_rpms (repo, override_replace_local_pkgs, &pkgs,
14441444
cancellable, error))
14451445
return FALSE;
14461446

0 commit comments

Comments
 (0)