Skip to content

Commit d93cab7

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 a25ded6 commit d93cab7

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/app/rpmostree-builtin-upgrade.cxx

+4
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[]
@@ -72,6 +73,8 @@ static GOptionEntry option_entries[]
7273
"Prevent automatic deployment finalization on shutdown", NULL },
7374
{ "bypass-driver", 0, 0, G_OPTION_ARG_NONE, &opt_bypass_driver,
7475
"Force an upgrade even if an updates driver is registered", NULL },
76+
{ "ex-reset-overrides", 0, G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE,
77+
&opt_ex_reset_overrides, "Reset overrides before upgrade", NULL },
7578
{ NULL } };
7679

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

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

src/daemon/rpmostreed-transaction-types.cxx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1301,8 +1301,8 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, GCancellable *ca
13011301
return FALSE;
13021302
}
13031303
}
1304-
1305-
if (no_overrides)
1304+
const gboolean ex_reset_overrides = vardict_lookup_bool (self->options, "ex-reset-overrides", FALSE);
1305+
if (no_overrides || (is_upgrade && ex_reset_overrides))
13061306
{
13071307
if (rpmostree_origin_remove_all_overrides (origin))
13081308
changed = TRUE;

0 commit comments

Comments
 (0)