Skip to content

Commit

Permalink
owut: message cleanup
Browse files Browse the repository at this point in the history
Fix up some output issues.  Make sure to warn about downgrades when
doing 'check'.

Signed-off-by: Eric Fahlgren <[email protected]>
  • Loading branch information
efahl committed Feb 4, 2025
1 parent 5823db3 commit 5aa75b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions files/owut
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const Logger = {
mark: function() { this._n_lines = 0; },
backup: function() {
// Reposition cursor up n lines and reset line counter.
if (! this.stdout_is_pipe) {
if (! this.stdout_is_pipe && this._n_lines > 0) {
printf("\033[%dA\r", this._n_lines);
fs.stdout.flush();
}
Expand Down Expand Up @@ -2052,7 +2052,7 @@ function run_pre_install_hook()
if (result?.stderr) L.log(0, result.stderr);
if (result.code != 0)
L.die(`Pre-install script '${options.pre_install}' failed with status ${result.code}, aborting upgrade\n`);
L.log(1, "Pre-install script terminated, proceeding with upgrade\n");
L.log(1, "Pre-install script successful, proceeding with upgrade\n");
}
}

Expand Down Expand Up @@ -2111,6 +2111,8 @@ switch (options.command) {
check_init_script();
if (exit_status != EXIT_OK)
L.err("Checks reveal errors, do not upgrade\n");
else if (updates.downgrades)
L.wrn("Checks reveal package downgrades, upgrade still possible with '--force'\n");
else if (updates.changes == 0)
L.log(0, "There are no changes, upgrade not necessary\n");
else
Expand Down

0 comments on commit 5aa75b6

Please sign in to comment.