Skip to content

Commit 4da8036

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 4da8036

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-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

+8-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;
@@ -1407,9 +1407,15 @@ deploy_transaction_execute (RpmostreedTransaction *transaction, GCancellable *ca
14071407

14081408
if (override_replace_local_pkgs)
14091409
{
1410+
<<<<<<< HEAD
14101411
g_autoptr (GPtrArray) pkgs = NULL;
14111412
if (!import_many_local_rpms (repo, override_replace_local_pkgs, &pkgs, cancellable,
14121413
error))
1414+
=======
1415+
g_autoptr(GPtrArray) pkgs = NULL;
1416+
if (!import_many_local_rpms (repo, override_replace_local_pkgs, &pkgs,
1417+
cancellable, error))
1418+
>>>>>>> 1808734c (upgrade: add experimental option to reset overrides)
14131419
return FALSE;
14141420

14151421
for (guint i = 0; i < pkgs->len; i++)

0 commit comments

Comments
 (0)