[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/01: import: cpan: Change %corelist into a promise.
From: |
Mark H. Weaver |
Subject: |
01/01: import: cpan: Change %corelist into a promise. |
Date: |
Fri, 20 Feb 2015 21:28:03 +0000 |
mhw pushed a commit to branch master
in repository guix.
commit 431b28d9dc6767b4ecc14d6c7aac9d3fe56673f8
Author: Mark H Weaver <address@hidden>
Date: Fri Feb 20 16:20:38 2015 -0500
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'.
---
guix/import/cpan.scm | 18 ++++++++++--------
1 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 3dc6eda..37dd3b1 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Eric Bavier <address@hidden>
+;;; Copyright © 2015 Mark H Weaver <address@hidden>
;;;
;;; 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))
(define %corelist
- (let* ((perl (with-store store
- (derivation->output-path
- (package-derivation store perl))))
- (core (string-append perl "/bin/corelist")))
- (and (access? core X_OK)
- core)))
+ (delay
+ (let* ((perl (with-store store
+ (derivation->output-path
+ (package-derivation store perl))))
+ (core (string-append perl "/bin/corelist")))
+ (and (access? core X_OK)
+ core))))
(define (cpan-module->sexp meta)
"Return the `package' s-expression for a CPAN module from the metadata in
@@ -120,9 +122,9 @@ META."
(assoc-ref meta "version"))
(define (core-module? name)
- (and %corelist
+ (and (force %corelist)
(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)))
(if (eof-object? line)
(begin (close-pipe corelist) #f)