From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/3] import: hackage: Silence download output. Date: Mon, 28 Mar 2016 18:07:40 +0200 Message-ID: <87y492si0j.fsf@gnu.org> References: <1458705269-31766-1-git-send-email-ericbavier@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1akZhm-00031D-1v for guix-devel@gnu.org; Mon, 28 Mar 2016 12:07:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1akZhl-0004GH-0p for guix-devel@gnu.org; Mon, 28 Mar 2016 12:07:49 -0400 In-Reply-To: <1458705269-31766-1-git-send-email-ericbavier@openmailbox.org> (ericbavier@openmailbox.org's message of "Tue, 22 Mar 2016 22:54:27 -0500") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: ericbavier@openmailbox.org Cc: guix-devel@gnu.org, Eric Bavier ericbavier@openmailbox.org skribis: > From: Eric Bavier > > * 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=E2=80=99.