void-linux / xbps

The X Binary Package System (XBPS)
https://voidlinux.org/xbps/
Other
821 stars 124 forks source link

xbps-install: transaction summary is sometimes not printed due to buffering #469

Closed paper42 closed 2 years ago

paper42 commented 2 years ago
%: ssh <hostname> doas xbps-install -Su
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/musl/x86_64-musl-repodata' ...
Do you want to continue? [Y/n]

When I press n, the rest gets printed, so this is a buffering issue.

% ssh <hostname> doas xbps-install -Su
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/musl/x86_64-musl-repodata' ...
Do you want to continue? [Y/n] n
1 package will be updated:

  spdx-licenses-list (3.15_1 -> 3.16_1) 

Size required on disk:         6867B
Space available on disk:        21GB

Aborting!

Adding fflush before the "Do you want to continue?" question solves the problem with xbps-install -Su:

--- a/bin/xbps-install/transaction.c
+++ b/bin/xbps-install/transaction.c
@@ -419,6 +419,7 @@ proceed:
     */
    if ((rv = show_transaction_sizes(trans, maxcols)) != 0)
        goto out;
+   fflush(stdout);
    /*
     * Ask interactively (if -y not set).
     */
%: ssh <hostname> doas xbps-install -Su
[*] Updating repository `https://alpha.de.repo.voidlinux.org/current/musl/x86_64-musl-repodata' ...
1 package will be updated:

  spdx-licenses-list (3.15_1 -> 3.16_1) 

Size required on disk:         6867B
Space available on disk:        21GB

Do you want to continue? [Y/n]

but it doesn't solve everything and I don't know what's happening here:

%: ssh <hostname> doas xbps-install -f xbps
1 package will be installed:

Size required on disk:         462KB
Space available on disk:        21GB

Do you want to continue? [Y/n] n
Aborting!
Chocimier commented 2 years ago

Last thing is that reinstall aren't printed in summary, fixed in #321.