download-nar: Distinguish ‘output’ and ‘item’ parameter.
This is useful when running a ‘--check’ build, where the output file name differs from the store file name we are trying to restore. * guix/build/download-nar.scm (download-nar): Add ‘output’ parameter and distinguish it from ‘item’. Change-Id: I42219b6d4c8fd1ed506720301384efc1aa351561master
parent
8a42fc7140
commit
3e9bea7ee3
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2017, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2017, 2019, 2020, 2024 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -57,9 +57,9 @@ ITEM."
|
||||||
(restore-file decompressed-port
|
(restore-file decompressed-port
|
||||||
item))))
|
item))))
|
||||||
|
|
||||||
(define (download-nar item)
|
(define* (download-nar item #:optional (output item))
|
||||||
"Download and extract the normalized archive for ITEM. Return #t on
|
"Download and extract to OUTPUT the normalized archive for ITEM, a store
|
||||||
success, #f otherwise."
|
item. Return #t on success, #f otherwise."
|
||||||
;; Let progress reports go through.
|
;; Let progress reports go through.
|
||||||
(setvbuf (current-error-port) 'none)
|
(setvbuf (current-error-port) 'none)
|
||||||
(setvbuf (current-output-port) 'none)
|
(setvbuf (current-output-port) 'none)
|
||||||
|
@ -96,10 +96,10 @@ success, #f otherwise."
|
||||||
#:download-size size)))
|
#:download-size size)))
|
||||||
(if (string-contains url "/lzip")
|
(if (string-contains url "/lzip")
|
||||||
(restore-lzipped-nar port-with-progress
|
(restore-lzipped-nar port-with-progress
|
||||||
item
|
output
|
||||||
size)
|
size)
|
||||||
(restore-file port-with-progress
|
(restore-file port-with-progress
|
||||||
item)))
|
output)))
|
||||||
(newline)
|
(newline)
|
||||||
#t))))
|
#t))))
|
||||||
(()
|
(()
|
||||||
|
|
Reference in New Issue