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
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/app/rpmostree-builtin-upgrade.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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[]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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. */
Expand Down
4 changes: 2 additions & 2 deletions src/daemon/rpmostreed-transaction-types.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down