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
This commit is contained in:
Ricardo Wurmus 2024-11-01 13:40:17 +01:00
parent 8f49545fed
commit 69ac9b72ce
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -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))