Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade: add experimental option to reset overrides #3063

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Razaloc committed Dec 22, 2022
commit d93cab7cf7597bd519011f6f7a0b3b9bb2276707
4 changes: 4 additions & 0 deletions src/app/rpmostree-builtin-upgrade.cxx
Original file line number Diff line number Diff line change
@@ -43,6 +43,7 @@ static gboolean opt_download_only;
static char *opt_automatic;
static gboolean opt_lock_finalization;
static gboolean opt_bypass_driver;
static gboolean opt_ex_reset_overrides;

/* "check-diff" is deprecated, replaced by "preview" */
static GOptionEntry option_entries[]
@@ -72,6 +73,8 @@ static GOptionEntry option_entries[]
"Prevent automatic deployment finalization on shutdown", NULL },
{ "bypass-driver", 0, 0, G_OPTION_ARG_NONE, &opt_bypass_driver,
"Force an upgrade even if an updates driver is registered", NULL },
{ "ex-reset-overrides", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE,
&opt_ex_reset_overrides, "Reset overrides before upgrade", NULL },
{ NULL } };

gboolean
@@ -171,6 +174,7 @@ rpmostree_builtin_upgrade (int argc, char **argv, RpmOstreeCommandInvocation *in
g_variant_dict_insert (&dict, "download-only", "b", opt_download_only);
g_variant_dict_insert (&dict, "lock-finalization", "b", opt_lock_finalization);
g_variant_dict_insert (&dict, "initiating-command-line", "s", invocation->command_line);
g_variant_dict_insert (&dict, "ex-reset-overrides", "b", opt_ex_reset_overrides);
g_autoptr (GVariant) options = g_variant_ref_sink (g_variant_dict_end (&dict));

/* Use newer D-Bus API only if we have to. */
4 changes: 2 additions & 2 deletions src/daemon/rpmostreed-transaction-types.cxx
Original file line number Diff line number Diff line change
@@ -1301,8 +1301,8 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, GCancellable *ca
return FALSE;
}
}

if (no_overrides)
const gboolean ex_reset_overrides = vardict_lookup_bool (self->options, "ex-reset-overrides", FALSE);
if (no_overrides || (is_upgrade && ex_reset_overrides))
{
if (rpmostree_origin_remove_all_overrides (origin))
changed = TRUE;