From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZkay-0003I3-Mo for guix-patches@gnu.org; Thu, 11 Jan 2018 16:41:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZkat-000311-NN for guix-patches@gnu.org; Thu, 11 Jan 2018 16:41:08 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:44659) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eZkat-00030s-Jx for guix-patches@gnu.org; Thu, 11 Jan 2018 16:41:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eZkas-0002o6-EC for guix-patches@gnu.org; Thu, 11 Jan 2018 16:41:03 -0500 Subject: [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <877etaq5si.fsf@gmail.com> Date: Thu, 11 Jan 2018 22:39:59 +0100 In-Reply-To: <877etaq5si.fsf@gmail.com> (Oleg Pykhalov's message of "Mon, 25 Dec 2017 16:46:21 +0300") Message-ID: <87373cnkgg.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Oleg Pykhalov Cc: 29847@debbugs.gnu.org Hi Oleg, Oleg Pykhalov skribis: > If pypi->guix-package fails to get a source release, could we return > false instead of killing a running Guile REPL session? Note that at the REPL you can always do: (catch 'quit (lambda () =E2=80=A6) (const #f)) > (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))) OK for the patch, but please simply replace =E2=80=98leave=E2=80=99 with = =E2=80=98warning=E2=80=99. Note that for me the motivation is not to avoid exiting REPLs since it=E2= =80=99s easy to avoid anyway. The motivation is rather to make it easier to integrate importers in applications other than =E2=80=98guix import=E2=80= =99: =E2=80=98guix refresh=E2=80=99 is one of them, but then I=E2=80=99d also like importers/u= pdaters to be directly used from =E2=80=98guix package=E2=80=99. For that, it=E2=80=99s = a good idea to avoid calling =E2=80=98exit=E2=80=99 on the first occasion, obviously. Thanks, Ludo=E2=80=99.