guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#45146] [PATCH] scripts: substitute: Improve fetch-narinfos progress


From: Ludovic Courtès
Subject: [bug#45146] [PATCH] scripts: substitute: Improve fetch-narinfos progress reporting.
Date: Fri, 11 Dec 2020 19:01:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi,

Christopher Baines <mail@cbaines.net> skribis:

> At least in guix weather, these changes make the progress bar actually appear.
>
> * guix/scripts/substitute.scm (fetch-narinfos): Use (guix progress) for
> progress reporting.

Cool.  I noticed that something was wrong with ‘guix weather’, but I
suspected it had to do with the order in which the erase-line sequence
and \r are sent.

> -      (lambda ()
> -        (display "\r\x1b[K" (current-error-port)) ;erase current line
> -        (force-output (current-error-port))
> -        (format (current-error-port)
> -                (G_ "updating substitutes from '~a'... ~5,1f%")
> -                url (* 100. (/ done total)))
> -        (set! done (+ 1 done)))))
> +  (define fetch-narinfos-progress-reporter
> +    (progress-reporter/bar (length paths)))

The problem here is that we’d see a progress bar without knowing what it
represents.

Besides, currently output from ‘guix substitute’ is printed as is by
client commands, regardless of whether stdout is a tty.  The problem
already exists but it would become a bit more visible as logs get filled
with progress bars.

Ludo’.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]