Skip to content

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

@paper42

Description

@paper42
%: 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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions