mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2025-01-18 21:46:35 +01:00
substitute: Parse '_NIX_OPTIONS' once.
* guix/scripts/substitute.scm (find-daemon-option): Arrange to call 'daemon-options' only once.
This commit is contained in:
parent
47c1de22df
commit
007e697560
1 changed files with 6 additions and 4 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2013-2022 Ludovic Courtès <ludo@gnu.org>
|
;;; Copyright © 2013-2023 Ludovic Courtès <ludo@gnu.org>
|
||||||
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
|
;;; Copyright © 2014 Nikita Karetnikov <nikita@karetnikov.org>
|
||||||
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
|
;;; Copyright © 2018 Kyle Meyer <kyle@kyleam.com>
|
||||||
;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
|
;;; Copyright © 2020 Christopher Baines <mail@cbaines.net>
|
||||||
|
@ -706,10 +706,12 @@ (define %not-newline
|
||||||
(string-drop option=value (+ 1 equal-sign))))))
|
(string-drop option=value (+ 1 equal-sign))))))
|
||||||
(string-tokenize newline-separated %not-newline)))))
|
(string-tokenize newline-separated %not-newline)))))
|
||||||
|
|
||||||
(define (find-daemon-option option)
|
(define find-daemon-option
|
||||||
"Return the value of build daemon option OPTION, or #f if it could not be
|
(let ((options (delay (daemon-options))))
|
||||||
|
(lambda (option)
|
||||||
|
"Return the value of build daemon option OPTION, or #f if it could not be
|
||||||
found."
|
found."
|
||||||
(assoc-ref (daemon-options) option))
|
(assoc-ref (force options) option))))
|
||||||
|
|
||||||
(define %default-substitute-urls
|
(define %default-substitute-urls
|
||||||
(match (and=> (or (find-daemon-option "untrusted-substitute-urls") ;client
|
(match (and=> (or (find-daemon-option "untrusted-substitute-urls") ;client
|
||||||
|
|
Loading…
Reference in a new issue