summaryrefslogtreecommitdiff
path: root/guix/scripts/import/pypi.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-11-05 17:56:39 +0100
committerLudovic Courtès <ludo@gnu.org>2014-11-05 17:56:39 +0100
commit467a3c93db5341864bbe76b68c137ba140616b59 (patch)
tree14d3ced65b370ae249a3b100448692bb8aafd70e /guix/scripts/import/pypi.scm
parent63854bcbb16e6b52edf966db428c4a1f049c3af5 (diff)
import: pypi: Gracefully handle non-existent packages.
Fixes <http://bugs.gnu.org/18831>. Reported by Ian Denhardt <ian@zenhack.net>. * guix/import/pypi.scm (url-fetch, json-fetch, pypi-fetch): Augment docstring to mention #f on failure. (pypi->guix-package): Likewise, and actually return #f on failure. * guix/scripts/import/pypi.scm (guix-import-pypi): Call 'leave' when 'pypi->guix-package' returns #f.
Diffstat (limited to 'guix/scripts/import/pypi.scm')
-rw-r--r--guix/scripts/import/pypi.scm6
1 files changed, 5 insertions, 1 deletions
diff --git a/guix/scripts/import/pypi.scm b/guix/scripts/import/pypi.scm
index 0aaa23a158..a36065e5cf 100644
--- a/guix/scripts/import/pypi.scm
+++ b/guix/scripts/import/pypi.scm
@@ -80,4 +80,8 @@ Import and convert the PyPI package for PACKAGE-NAME.\n"))
(reverse opts))))
(match args
((package-name)
- (pypi->guix-package package-name)))))
+ (let ((sexp (pypi->guix-package package-name)))
+ (unless sexp
+ (leave (_ "failed to download meta-data for package '~a'~%")
+ package-name))
+ sexp)))))