utils: Turn 'parallel-job-count' into a parameter.

* guix/build/utils.scm (parallel-job-count): Turn into a SRFI-39 parameter.
This commit is contained in:
Ludovic Courtès 2014-11-22 21:57:05 +01:00
parent e8c7fdda5d
commit 1d1fa9327c

View file

@ -73,13 +73,13 @@ (define (%store-directory)
(or (getenv "NIX_STORE") (or (getenv "NIX_STORE")
"/gnu/store")) "/gnu/store"))
(define (parallel-job-count) (define parallel-job-count
"Return the number of processes to be passed next to GNU Make's `-j' ;; Number of processes to be passed next to GNU Make's `-j' argument.
argument." (make-parameter
(match (getenv "NIX_BUILD_CORES") ;set by the daemon (match (getenv "NIX_BUILD_CORES") ;set by the daemon
(#f 1) (#f 1)
("0" (current-processor-count)) ("0" (current-processor-count))
(x (or (string->number x) 1)))) (x (or (string->number x) 1)))))
(define (directory-exists? dir) (define (directory-exists? dir)
"Return #t if DIR exists and is a directory." "Return #t if DIR exists and is a directory."