From: Adrian Vovk Date: Sat, 31 Aug 2024 01:53:14 +0000 (-0400) Subject: updatectl: Ensure we clear the progress bar X-Git-Tag: v257-rc1~583^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2aff6efe677b1c1ff42677d9c8a7679373fb9712;p=thirdparty%2Fsystemd.git updatectl: Ensure we clear the progress bar Otherwise we end up half-overwriting the progress bar, which looks buggy --- diff --git a/src/sysupdate/updatectl.c b/src/sysupdate/updatectl.c index d5f74bff3ef..8f1e4e72db8 100644 --- a/src/sysupdate/updatectl.c +++ b/src/sysupdate/updatectl.c @@ -808,12 +808,15 @@ static int update_render_progress(sd_event_source *source, void *userdata) { int progress = PTR_TO_INT(p); if (progress == UPDATE_PROGRESS_FAILED) { + clear_progress_bar(target); fprintf(stderr, "%s %s\n", RED_CROSS_MARK(), target); total += 100; } else if (progress == -EALREADY) { + clear_progress_bar(target); fprintf(stderr, "%s %s (Already up-to-date)\n", GREEN_CHECK_MARK(), target); n--; /* Don't consider this target in the total */ } else if (progress < 0) { + clear_progress_bar(target); fprintf(stderr, "%s %s (%s)\n", RED_CROSS_MARK(), target, STRERROR(progress)); total += 100; } else {