From 69ac9b72ce3914c2d1c07f80a2e1db85c9035e5d Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Fri, 1 Nov 2024 13:40:17 +0100 Subject: [PATCH] import/cran: Do not crash when license field is missing. * guix/import/cran.scm (description->package): Do not process license as string when it's missing. Change-Id: I415fa6be17631f83c2aa7a213683fdf90a868e96 --- guix/import/cran.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/guix/import/cran.scm b/guix/import/cran.scm index 6ae00cae96..2a631c6b1c 100644 --- a/guix/import/cran.scm +++ b/guix/import/cran.scm @@ -737,7 +737,8 @@ (define* (description->package repository meta #:key (license-prefix identity) (name (assoc-ref meta "Package")) (synopsis (assoc-ref meta "Title")) (version (assoc-ref meta "Version")) - (license (string->licenses (assoc-ref meta "License") license-prefix)) + (license (and=> (assoc-ref meta "License") + (cut string->licenses <> license-prefix))) ;; Some packages have multiple home pages. Some have none. (home-page (case repository ((git) (assoc-ref meta 'git))