upgrade: Support --allow-downgrade again
This was unintentially dropped with the OstreeSysrootUpgrader rebase.
This commit is contained in:
1 parent
913337c557
commit
5bca569506
2 files changed
+10
-2
No files matched your search
@@ -464,8 +464,11 @@ ostree_sysroot_upgrader_pull (OstreeSysrootUpgrader *self,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
gboolean allow_older = (upgrader_flags & OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER) > 0;
|
||||||
|
|
||||||
*out_changed = TRUE;
|
*out_changed = TRUE;
|
||||||
if (from_revision)
|
|
||||||
|
if (from_revision && !allow_older)
|
||||||
{
|
{
|
||||||
if (!ostree_sysroot_upgrader_check_timestamps (repo, from_revision,
|
if (!ostree_sysroot_upgrader_check_timestamps (repo, from_revision,
|
||||||
self->new_revision,
|
self->new_revision,
|
||||||
|
|||||||
@@ -61,6 +61,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel
|
|||||||
GSConsole *console;
|
GSConsole *console;
|
||||||
gs_unref_object OstreeAsyncProgress *progress = NULL;
|
gs_unref_object OstreeAsyncProgress *progress = NULL;
|
||||||
gboolean changed;
|
gboolean changed;
|
||||||
|
OstreeSysrootUpgraderPullFlags upgraderpullflags = 0;
|
||||||
|
|
||||||
context = g_option_context_new ("Construct new tree from current origin and deploy it, if it changed");
|
context = g_option_context_new ("Construct new tree from current origin and deploy it, if it changed");
|
||||||
g_option_context_add_main_entries (context, options, NULL);
|
g_option_context_add_main_entries (context, options, NULL);
|
||||||
@@ -83,7 +84,11 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel
|
|||||||
progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
|
progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ostree_sysroot_upgrader_pull (upgrader, 0, 0, progress, &changed,
|
if (opt_allow_downgrade)
|
||||||
|
upgraderpullflags |= OSTREE_SYSROOT_UPGRADER_PULL_FLAGS_ALLOW_OLDER;
|
||||||
|
|
||||||
|
if (!ostree_sysroot_upgrader_pull (upgrader, 0, upgraderpullflags,
|
||||||
|
progress, &changed,
|
||||||
cancellable, error))
|
cancellable, error))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user