check-available-binaries: Use 'substitution-oracle'.

* build-aux/check-available-binaries.scm: Use 'substitution-oracle'.
  Changer caller and 'warn' accordingly.
This commit is contained in:
Ludovic Courtès 2015-01-14 18:28:46 +01:00
parent 619c9522b2
commit df5188ddfa
1 changed files with 10 additions and 10 deletions

View File

@ -37,18 +37,18 @@
%bootstrap-tarballs <>) %bootstrap-tarballs <>)
'("mips64el-linux-gnuabi64"))) '("mips64el-linux-gnuabi64")))
(total (append native cross))) (total (append native cross)))
(define (warn proc) (define (warn item system)
(lambda (drv) (format (current-error-port) "~a (~a) is not substitutable~%"
(or (proc drv) item system)
(begin #f)
(format (current-error-port) "~a is not substitutable~%"
drv)
#f))))
(set-build-options store #:use-substitutes? #t) (set-build-options store #:use-substitutes? #t)
(let ((result (every (compose (warn (cut has-substitutes? store <>)) (let* ((substitutable? (substitution-oracle store total))
derivation->output-path) (result (every (lambda (drv)
total))) (let ((out (derivation->output-path drv)))
(or (substitutable? out)
(warn out (derivation-system drv)))))
total)))
(when result (when result
(format (current-error-port) "~a packages found substitutable~%" (format (current-error-port) "~a packages found substitutable~%"
(length total))) (length total)))