import: opam: Do not crash when description is missing.

Previous 'guix import opam coccinelle' would crash due to the lack of a
description.

* guix/import/opam.scm (opam->guix-package): Call 'beautify-description'
only when "description" metadata is available.
This commit is contained in:
Ludovic Courtès 2023-01-23 18:20:41 +01:00
parent 9e4f1f8c33
commit a8792bc796
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -382,8 +382,8 @@ (define* (opam->guix-package name #:key (repo 'opam) version #:allow-other-keys)
,(list 'quasiquote `((upstream-name . ,name))))))
(home-page ,(metadata-ref opam-content "homepage"))
(synopsis ,(metadata-ref opam-content "synopsis"))
(description ,(beautify-description
(metadata-ref opam-content "description")))
(description ,(and=> (metadata-ref opam-content "description")
beautify-description))
(license ,(spdx-string->license
(metadata-ref opam-content "license"))))
(filter