summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-02-05 16:03:43 +0100
committerLudovic Courtès <ludo@gnu.org>2020-02-05 16:18:58 +0100
commitc24fe4a52057ea3390faf59fd672a617eff34aea (patch)
tree08af7111f8be5b909266af1ff87143cd81a1f811 /guix
parent23db83333568266972e666ee66574db29cdbbdc7 (diff)
import: gem: Deal with unavailable licensing info.
Fixes <https://bugs.gnu.org/39404>. Reported by Seth <lee.seth@tuta.io>. * guix/import/gem.scm (<gem>)[licenses]: Adjust for non-vector licenses. * tests/gem.scm (test-bar-json): Change "licenses" to 'null'. ("gem-recursive-import"): Adjust accordingly.
Diffstat (limited to 'guix')
-rw-r--r--guix/import/gem.scm7
1 files changed, 6 insertions, 1 deletions
diff --git a/guix/import/gem.scm b/guix/import/gem.scm
index f4589b98b3..bd5d5b3569 100644
--- a/guix/import/gem.scm
+++ b/guix/import/gem.scm
@@ -44,7 +44,12 @@
(version gem-version) ;string
(authors gem-authors) ;string
(licenses gem-licenses "licenses" ;list of strings
- vector->list)
+ (lambda (licenses)
+ ;; This is sometimes #nil (the JSON 'null' value). Arrange
+ ;; to always return a list.
+ (cond ((not licenses) '())
+ ((vector? licenses) (vector->list licenses))
+ (else '()))))
(info gem-info)
(sha256 gem-sha256 "sha" ;bytevector
base16-string->bytevector)