check-available-binaries: Use 'substitutable-paths'.

* build-aux/check-available-binaries.scm: Rewrite to use 'substitutable-paths'
  instead of 'substitution-oracle'.  The latter does more than we need, and it
  no longer check the substitutability of valid items, which is not what we
  want.  Use 'lset-difference' instead of iterating over the items.
This commit is contained in:
Ludovic Courtès 2015-07-21 22:28:20 +02:00
parent e9ade3eeef
commit e348eaaf31
1 changed files with 12 additions and 15 deletions

View File

@ -26,7 +26,8 @@
(gnu packages emacs) (gnu packages emacs)
(gnu packages make-bootstrap) (gnu packages make-bootstrap)
(srfi srfi-1) (srfi srfi-1)
(srfi srfi-26)) (srfi srfi-26)
(ice-9 format))
(with-store store (with-store store
(parameterize ((%graft? #f)) (parameterize ((%graft? #f))
@ -38,19 +39,15 @@
%bootstrap-tarballs <>) %bootstrap-tarballs <>)
'("mips64el-linux-gnuabi64"))) '("mips64el-linux-gnuabi64")))
(total (append native cross))) (total (append native cross)))
(define (warn item system)
(format (current-error-port) "~a (~a) is not substitutable~%"
item system)
#f)
(set-build-options store #:use-substitutes? #t) (set-build-options store #:use-substitutes? #t)
(let* ((substitutable? (substitution-oracle store total)) (let* ((total (map derivation->output-path total))
(result (every (lambda (drv) (available (substitutable-paths store total))
(let ((out (derivation->output-path drv))) (missing (lset-difference string=? total available)))
(or (substitutable? out) (if (null? missing)
(warn out (derivation-system drv))))) (format (current-error-port) "~a packages found substitutable~%"
total))) (length total))
(when result (format (current-error-port)
(format (current-error-port) "~a packages found substitutable~%" "~a packages are not substitutable:~%~{ ~a~%~}~%"
(length total))) (length missing) missing))
(exit result))))) (exit (null? missing))))))