diff mbox

import/cpan: Maybe coerce version to string.

Message ID 20161112172005.4445-2-alex@pompo.co
State New
Headers show

Commit Message

Alex Sassmannshausen Nov. 12, 2016, 5:20 p.m. UTC
* guix/import/cpan.scm (cpan-module->sexp) <version>: Test if version in
  meta is string or number.  If it is number, coerce to string.
---
 guix/import/cpan.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Ludovic Courtès Nov. 13, 2016, 12:13 p.m. UTC | #1
Alex Sassmannshausen <alex.sassmannshausen@gmail.com> skribis:

> * guix/import/cpan.scm (cpan-module->sexp) <version>: Test if version in
>   meta is string or number.  If it is number, coerce to string.

LGTM, thanks!

Ludo’.
diff mbox

Patch

diff --git a/guix/import/cpan.scm b/guix/import/cpan.scm
index 5b7c475..d244969 100644
--- a/guix/import/cpan.scm
+++ b/guix/import/cpan.scm
@@ -128,7 +128,9 @@  META."
         (string-append "perl-" (string-downcase name))))
 
   (define version
-    (assoc-ref meta "version"))
+    (match (assoc-ref meta "version")
+      ((? number? vrs) (number->string vrs))
+      ((? string? vrs) vrs)))
 
   (define core-module?
     (let ((perl-version (package-version perl))