challenge: Be defensive in the size passed to the progress reporter.
Possibly fixes <https://bugs.gnu.org/48045>. Reported by Bone Baboon <bone.baboon@disroot.org>. * guix/scripts/challenge.scm (call-with-nar): Rename second value returned by 'http-fetch' to match reality. Change second argument to 'progress-reporter/file'.
This commit is contained in:
parent
0aef94e7bc
commit
3cde5231aa
1 changed files with 4 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2015, 2016, 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2015, 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -253,10 +253,11 @@ taken since we do not import the archives."
|
||||||
NARINFO."
|
NARINFO."
|
||||||
(let*-values (((uri compression size)
|
(let*-values (((uri compression size)
|
||||||
(narinfo-best-uri narinfo))
|
(narinfo-best-uri narinfo))
|
||||||
((port response)
|
((port actual-size)
|
||||||
(http-fetch uri)))
|
(http-fetch uri)))
|
||||||
(define reporter
|
(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))))
|
#:abbreviation (const (uri-host uri))))
|
||||||
|
|
||||||
(define result
|
(define result
|
||||||
|
|
Reference in a new issue