From 1327ec822fa6dd396e979efd8d4e1f7479f1d5b3 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Thu, 7 Oct 2021 09:50:26 +0200 Subject: import: crate: Gracefully handle missing license info. Fixes . Reported by Michael Zappa . * guix/import/crate.scm ()[license]: Translate 'null to #f. (make-crate-sexp): Handle LICENSE = #f. --- guix/import/crate.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'guix') diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 287ffd2536..c76d7e9c1a 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2016 David Craven -;;; Copyright © 2019, 2020 Ludovic Courtès +;;; Copyright © 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2019, 2020 Martin Becze ;;; Copyright © 2021 Nicolas Goaziou ;;; @@ -79,7 +79,10 @@ (number crate-version-number "num") ;string (download-path crate-version-download-path "dl_path") ;string (readme-path crate-version-readme-path "readme_path") ;string - (license crate-version-license "license") ;string + (license crate-version-license "license" ;string | #f + (match-lambda + ('null #f) + ((? string? str) str))) (links crate-version-links)) ;alist ;; Crate dependency. Each dependency (each edge in the graph) is annotated as @@ -198,6 +201,7 @@ and LICENSE." (description ,(beautify-description description)) (license ,(match license (() #f) + (#f #f) ((license) license) (_ `(list ,@license))))))) (close-port port) -- cgit v1.2.3