import: pypi: Gracefully handle missing project home page.
Fixes <https://issues.guix.gnu.org/54259>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/import/pypi.scm (pypi->guix-package): Upon 'missing-source-error?', raise '&fix-hint' only if 'project-info-home-page' returns a non-empty string.
This commit is contained in:
parent
ad464b1704
commit
ebb03447f8
@ -500,19 +500,22 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
|
|||||||
(guard (c ((missing-source-error? c)
|
(guard (c ((missing-source-error? c)
|
||||||
(let ((package (missing-source-error-package c)))
|
(let ((package (missing-source-error-package c)))
|
||||||
(raise
|
(raise
|
||||||
(make-compound-condition
|
(apply
|
||||||
|
make-compound-condition
|
||||||
(formatted-message
|
(formatted-message
|
||||||
(G_ "no source release for pypi package ~a ~a~%")
|
(G_ "no source release for pypi package ~a ~a~%")
|
||||||
(project-info-name info) version)
|
(project-info-name info) version)
|
||||||
(condition
|
(match (project-info-home-page info)
|
||||||
(&fix-hint
|
((or #f "") '())
|
||||||
(hint (format #f (G_ "This indicates that the
|
(url
|
||||||
|
(list
|
||||||
|
(condition
|
||||||
|
(&fix-hint
|
||||||
|
(hint (format #f (G_ "This indicates that the
|
||||||
package is available on PyPI, but only as a \"wheel\" containing binaries, not
|
package is available on PyPI, but only as a \"wheel\" containing binaries, not
|
||||||
source. To build it from source, refer to the upstream repository at
|
source. To build it from source, refer to the upstream repository at
|
||||||
@uref{~a}.")
|
@uref{~a}.")
|
||||||
(or (project-info-home-page info)
|
url))))))))))))
|
||||||
(project-info-url info)
|
|
||||||
"?"))))))))))
|
|
||||||
(make-pypi-sexp (project-info-name info) version
|
(make-pypi-sexp (project-info-name info) version
|
||||||
(and=> (source-release project version)
|
(and=> (source-release project version)
|
||||||
distribution-url)
|
distribution-url)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user