From 3cde5231aa78aa5e31b27888cd78ee0b250a7a1c Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Wed, 12 May 2021 23:38:13 +0200 Subject: challenge: Be defensive in the size passed to the progress reporter. Possibly fixes . Reported by Bone Baboon . * guix/scripts/challenge.scm (call-with-nar): Rename second value returned by 'http-fetch' to match reality. Change second argument to 'progress-reporter/file'. --- guix/scripts/challenge.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/scripts/challenge.scm b/guix/scripts/challenge.scm index 4ec3be99ca..07477f816e 100644 --- a/guix/scripts/challenge.scm +++ b/guix/scripts/challenge.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès +;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -253,10 +253,11 @@ (define (call-with-nar narinfo proc) NARINFO." (let*-values (((uri compression size) (narinfo-best-uri narinfo)) - ((port response) + ((port actual-size) (http-fetch uri))) (define reporter - (progress-reporter/file (narinfo-path narinfo) size + (progress-reporter/file (narinfo-path narinfo) + (max size (or actual-size 0)) ;defensive #:abbreviation (const (uri-host uri)))) (define result -- cgit v1.2.3