mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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.
This commit is contained in:
parent
23db833335
commit
c24fe4a520
2 changed files with 8 additions and 3 deletions
|
@ -44,7 +44,12 @@ (define-json-mapping <gem> make-gem gem?
|
||||||
(version gem-version) ;string
|
(version gem-version) ;string
|
||||||
(authors gem-authors) ;string
|
(authors gem-authors) ;string
|
||||||
(licenses gem-licenses "licenses" ;list of strings
|
(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)
|
(info gem-info)
|
||||||
(sha256 gem-sha256 "sha" ;bytevector
|
(sha256 gem-sha256 "sha" ;bytevector
|
||||||
base16-string->bytevector)
|
base16-string->bytevector)
|
||||||
|
|
|
@ -55,7 +55,7 @@ (define test-bar-json
|
||||||
{ \"name\": \"bundler\" },
|
{ \"name\": \"bundler\" },
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
\"licenses\": [\"MIT\", \"Apache 2.0\"]
|
\"licenses\": null
|
||||||
}")
|
}")
|
||||||
|
|
||||||
(define test-bundler-json
|
(define test-bundler-json
|
||||||
|
@ -138,7 +138,7 @@ (define test-bundler-json
|
||||||
('synopsis "Another cool gem")
|
('synopsis "Another cool gem")
|
||||||
('description "Another cool gem")
|
('description "Another cool gem")
|
||||||
('home-page "https://example.com")
|
('home-page "https://example.com")
|
||||||
('license ('list 'license:expat 'license:asl2.0)))
|
('license #f)) ;no licensing info
|
||||||
('package
|
('package
|
||||||
('name "ruby-bundler")
|
('name "ruby-bundler")
|
||||||
('version "1.14.2")
|
('version "1.14.2")
|
||||||
|
|
Loading…
Reference in a new issue