guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/3] import: hackage: Silence download output.


From: Ludovic Courtès
Subject: Re: [PATCH 1/3] import: hackage: Silence download output.
Date: Mon, 28 Mar 2016 18:07:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

address@hidden skribis:

> From: Eric Bavier <address@hidden>
>
> * guix/import/hackage.scm (hackage-fetch): Send error output from
>   url-fetch to /dev/null.

[...]

> +    ;; XXX: We want to silence the download progress report, which is
> +    ;; especially annoying for 'guix refresh', but we have to use a file 
> port.
>      (call-with-temporary-output-file
>       (lambda (temp port)
> -       (and (url-fetch url temp)
> +       (and (call-with-output-file "/dev/null"
> +              (lambda (null)
> +                (with-error-to-port null
> +                  (lambda () (url-fetch url temp)))))
>              (call-with-input-file temp
>                (compose read-cabal canonical-newline-port)))))))

Would it work to directly use:

  (let* ((port   (http-fetch url))    ;from (guix http-client)
         (result (read-cabal (canonical-newline-port port))))
    (close-port port)
    result)

This avoids the creation of a temporary file.

TIA,
Ludo’.



reply via email to

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