[bug#34249] guix package: Avoid spinner at end of output.

Message ID 20190129195031.21496-1-mail@cbaines.net
State Accepted
Headers show
Series [bug#34249] guix package: Avoid spinner at end of output. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied

Commit Message

Christopher Baines Jan. 29, 2019, 7:50 p.m. UTC
Often guix package will report something like the following when performing
operations, for example:

  guix package -i hello
  ...
  building /gnu/store/wiwqmbi66gcr27dac3qqgrc8imyp1344-profile.drv...
  -117 packages in profile

Now there aren't -117 packages in this profile, it's just the spinner running
in to the output from Guix package. I'm not sure if this is a proper solution
for this issue, but it does work.

* guix/scripts/package.scm (build-and-use-profile): Erase the spinner before
output.
---
 guix/scripts/package.scm | 1 +
 1 file changed, 1 insertion(+)

Comments

Danny Milosavljevic Jan. 29, 2019, 8:16 p.m. UTC | #1
Hi Christopher,
> diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
> index a633d2ee6d..4db0e72e9b 100644
> --- a/guix/scripts/package.scm
> +++ b/guix/scripts/package.scm
> @@ -159,6 +159,7 @@ hooks\" run when building the profile."
>                 (switch-symlinks profile (basename name))
>                 (unless (string=? profile %current-profile)
>                   (register-gc-root store name))
> +               (display "\r") ; erase the spinner

In order to actually erase it, might want to do (display "\r\x1b[K") instead.

Patch

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index a633d2ee6d..4db0e72e9b 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -159,6 +159,7 @@  hooks\" run when building the profile."
                (switch-symlinks profile (basename name))
                (unless (string=? profile %current-profile)
                  (register-gc-root store name))
+               (display "\r") ; erase the spinner
                (format #t (N_ "~a package in profile~%"
                               "~a packages in profile~%"
                               count)