unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Oleg Pykhalov <go.wigust@gmail.com>
To: 29847@debbugs.gnu.org
Subject: [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source
Date: Mon, 25 Dec 2017 16:46:21 +0300	[thread overview]
Message-ID: <877etaq5si.fsf@gmail.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 138 bytes --]

Hello Guix,

If pypi->guix-package fails to get a source release, could we return
false instead of killing a running Guile REPL session?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: [PATCH] import: pypi: Stay in the REPL if fail to get a source --]
[-- Type: text/x-patch, Size: 1535 bytes --]

From 6bb461018fc4cd47d30ab27b5748b9e4cbce6e97 Mon Sep 17 00:00:00 2001
From: Oleg Pykhalov <go.wigust@gmail.com>
Date: Mon, 25 Dec 2017 16:32:14 +0300
Subject: [PATCH] import: pypi: Stay in the REPL if fail to get a source
 release.

* guix/import/pypi.scm (pypi->guix-package): Return #f if no source release.
---
 guix/import/pypi.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/guix/import/pypi.scm b/guix/import/pypi.scm
index bb0db1ba8..3f37ea65f 100644
--- a/guix/import/pypi.scm
+++ b/guix/import/pypi.scm
@@ -275,9 +275,11 @@ VERSION, SOURCE-URL, HOME-PAGE, SYNOPSIS, DESCRIPTION, and LICENSE."
     (and package
          (guard (c ((missing-source-error? c)
                     (let ((package (missing-source-error-package c)))
-                      (leave (G_ "no source release for pypi package ~a ~a~%")
-                             (assoc-ref* package "info" "name")
-                             (assoc-ref* package "info" "version")))))
+                      (format (current-error-port)
+                              (G_ "no source release for pypi package ~a ~a~%")
+                              (assoc-ref* package "info" "name")
+                              (assoc-ref* package "info" "version"))
+                      #f)))
            (let ((name (assoc-ref* package "info" "name"))
                  (version (assoc-ref* package "info" "version"))
                  (release (assoc-ref (latest-source-release package) "url"))
-- 
2.15.1


[-- Attachment #1.3: Type: text/plain, Size: 15 bytes --]


Thanks,
Oleg.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

             reply	other threads:[~2017-12-25 13:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-25 13:46 Oleg Pykhalov [this message]
2017-12-25 13:59 ` [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source ng0
2017-12-25 15:55   ` Oleg Pykhalov
2017-12-25 19:38     ` ng0
2017-12-29 11:14 ` Danny Milosavljevic
2018-01-11 21:39 ` Ludovic Courtès
2018-03-29 13:16   ` Ludovic Courtès
2018-04-01 13:26     ` Oleg Pykhalov
2018-04-02 16:16       ` bug#29847: " Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877etaq5si.fsf@gmail.com \
    --to=go.wigust@gmail.com \
    --cc=29847@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).