diff --git a/src/ostree/ot-admin-builtin-switch.c b/src/ostree/ot-admin-builtin-switch.c index 6884d9f6..ad652634 100644 --- a/src/ostree/ot-admin-builtin-switch.c +++ b/src/ostree/ot-admin-builtin-switch.c @@ -59,6 +59,7 @@ ot_admin_builtin_switch (int argc, char **argv, OstreeSysroot *sysroot, GCancell gs_unref_object OstreeAsyncProgress *progress = NULL; gboolean changed; GSConsole *console = NULL; + gboolean in_status_line = FALSE; GKeyFile *old_origin; GKeyFile *new_origin = NULL; @@ -113,6 +114,12 @@ ot_admin_builtin_switch (int argc, char **argv, OstreeSysroot *sysroot, GCancell progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console); } + if (in_status_line) + { + gs_console_end_status_line (console, NULL, NULL); + in_status_line = FALSE; + } + if (!ostree_sysroot_upgrader_pull (upgrader, 0, 0, progress, &changed, cancellable, error)) goto out; @@ -145,7 +152,7 @@ ot_admin_builtin_switch (int argc, char **argv, OstreeSysroot *sysroot, GCancell ret = TRUE; out: - if (console) + if (in_status_line) gs_console_end_status_line (console, NULL, NULL); if (new_origin) g_key_file_unref (new_origin); diff --git a/src/ostree/ot-admin-builtin-upgrade.c b/src/ostree/ot-admin-builtin-upgrade.c index 8d0c7cc9..46acfbc3 100644 --- a/src/ostree/ot-admin-builtin-upgrade.c +++ b/src/ostree/ot-admin-builtin-upgrade.c @@ -59,6 +59,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel gs_unref_object OstreeDeployment *merge_deployment = NULL; gs_unref_object OstreeDeployment *new_deployment = NULL; GSConsole *console = NULL; + gboolean in_status_line = FALSE; gs_unref_object OstreeAsyncProgress *progress = NULL; gboolean changed; OstreeSysrootUpgraderPullFlags upgraderpullflags = 0; @@ -81,6 +82,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel if (console) { gs_console_begin_status_line (console, "", NULL, NULL); + in_status_line = TRUE; progress = ostree_async_progress_new_and_connect (ot_common_pull_progress, console); } @@ -92,6 +94,12 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel cancellable, error)) goto out; + if (in_status_line) + { + gs_console_end_status_line (console, NULL, NULL); + in_status_line = FALSE; + } + if (!changed) { g_print ("No update available.\n"); @@ -113,7 +121,7 @@ ot_admin_builtin_upgrade (int argc, char **argv, OstreeSysroot *sysroot, GCancel ret = TRUE; out: - if (console) + if (in_status_line) gs_console_end_status_line (console, NULL, NULL); if (context) g_option_context_free (context);