import: cpan: Change %corelist into a promise.
Fixes compilation failures in 'guix pull'. * guix/import/cpan.scm (%corelist): Change it to a promise by wrapping it with 'delay'. (cpan-module->sexp): Adapt uses of %corelist by wrapping with 'force'.
This commit is contained in:
parent
2f4646b6f6
commit
431b28d9dc
|
@ -1,5 +1,6 @@
|
||||||
;;; GNU Guix --- Functional package management for GNU
|
;;; GNU Guix --- Functional package management for GNU
|
||||||
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
|
;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
|
||||||
|
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
|
||||||
;;;
|
;;;
|
||||||
;;; This file is part of GNU Guix.
|
;;; This file is part of GNU Guix.
|
||||||
;;;
|
;;;
|
||||||
|
@ -98,12 +99,13 @@ or #f on failure. MODULE should be e.g. \"Test::Script\""
|
||||||
(string-append "http://search.cpan.org/dist/" name))
|
(string-append "http://search.cpan.org/dist/" name))
|
||||||
|
|
||||||
(define %corelist
|
(define %corelist
|
||||||
(let* ((perl (with-store store
|
(delay
|
||||||
(derivation->output-path
|
(let* ((perl (with-store store
|
||||||
(package-derivation store perl))))
|
(derivation->output-path
|
||||||
(core (string-append perl "/bin/corelist")))
|
(package-derivation store perl))))
|
||||||
(and (access? core X_OK)
|
(core (string-append perl "/bin/corelist")))
|
||||||
core)))
|
(and (access? core X_OK)
|
||||||
|
core))))
|
||||||
|
|
||||||
(define (cpan-module->sexp meta)
|
(define (cpan-module->sexp meta)
|
||||||
"Return the `package' s-expression for a CPAN module from the metadata in
|
"Return the `package' s-expression for a CPAN module from the metadata in
|
||||||
|
@ -120,9 +122,9 @@ META."
|
||||||
(assoc-ref meta "version"))
|
(assoc-ref meta "version"))
|
||||||
|
|
||||||
(define (core-module? name)
|
(define (core-module? name)
|
||||||
(and %corelist
|
(and (force %corelist)
|
||||||
(parameterize ((current-error-port (%make-void-port "w")))
|
(parameterize ((current-error-port (%make-void-port "w")))
|
||||||
(let* ((corelist (open-pipe* OPEN_READ %corelist name)))
|
(let* ((corelist (open-pipe* OPEN_READ (force %corelist) name)))
|
||||||
(let loop ((line (read-line corelist)))
|
(let loop ((line (read-line corelist)))
|
||||||
(if (eof-object? line)
|
(if (eof-object? line)
|
||||||
(begin (close-pipe corelist) #f)
|
(begin (close-pipe corelist) #f)
|
||||||
|
|
Loading…
Reference in New Issue