From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52713) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f2d0k-0001Rv-ID for guix-patches@gnu.org; Sun, 01 Apr 2018 09:27:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f2d0g-0000g5-Jt for guix-patches@gnu.org; Sun, 01 Apr 2018 09:27:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:53926) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f2d0g-0000fw-Ga for guix-patches@gnu.org; Sun, 01 Apr 2018 09:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f2d0g-0004kd-9e for guix-patches@gnu.org; Sun, 01 Apr 2018 09:27:02 -0400 Subject: [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source Resent-Message-ID: From: Oleg Pykhalov References: <877etaq5si.fsf@gmail.com> <87373cnkgg.fsf@gnu.org> <87605fvx6i.fsf@gnu.org> Date: Sun, 01 Apr 2018 16:26:38 +0300 In-Reply-To: <87605fvx6i.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Thu, 29 Mar 2018 15:16:53 +0200") Message-ID: <87zi2nnjld.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 29847@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello Ludovic, Apologies for a long reply. ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Ping! > > ludo@gnu.org (Ludovic Court=C3=A8s) skribis: > >> OK for the patch, but please simply replace =E2=80=98leave=E2=80=99 with= =E2=80=98warning=E2=80=99. I think the patch is no longer needed, because =E2=80=98pypi->guix-package= =E2=80=99 returns false (=E2=80=98#f=E2=80=99) and REPL survives if a package doesn't= exist: =2D-8<---------------cut here---------------start------------->8--- scheme@(guix import pypi)> (pypi->guix-package "psutil") Starting download of /tmp/guix-file.9Q8PGN From=20https://pypi.python.org/packages/e2/e1/600326635f97fee89bf8426fef14c= 5c29f4849c79f68fd79f433d8c1bd96/psutil-5.4.3.tar.gz... =E2=80=A64.3.tar.gz 403KiB 1.6MiB/s 00:00 [#############= #####] 100.0% Starting download of /tmp/guix-file.Vn9nDZ From=20https://pypi.python.org/packages/e5/cc/6dd427e738a8db6d0b66525856da4= 3d2ef12c4c19269863927f7cf0e2aaf/psutil-5.4.3-cp27-none-win32.whl... =E2=80=A67-none-win32.whl 216KiB 1.3MiB/s 00:00 [#############= #####] 100.0% $3 =3D (package (name "python-psutil") #; more fields here) scheme@(guix import pypi)> (pypi->guix-package "psutils") ; =E2=80=98psutil= s=E2=80=99 doesn't exist in =E2=80=98pypi=E2=80=99 $4 =3D #f =2D-8<---------------cut here---------------end--------------->8--- WDYT? > Note that at the REPL you can always do: > > (catch 'quit (lambda () =E2=80=A6) (const #f)) Thank you! Based on this I wrote a macro: (define-macro (try function) `(catch 'quit (lambda () ,function) (const #f))) but I don't know how to make it available after invoking =E2=80=98guile=E2= =80=99 in Bash. Putting the macro in =E2=80=98~/.guile=E2=80=99 doesn't help unfortu= nately. Thanks, Oleg. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEc+OyAXw1EaDPCmAPckbhHGm3lWkFAlrA3g4ACgkQckbhHGm3 lWkVaQ//baFL3CQDCWxGlMgntuyvh2ipBG8hK9Pmm/gWm538wapp0rM+25Cuhdiu 4xmHNabVp7HyUaQxGqloQFxd5Us7oA6ZwTPjvIvXVq2+6PVxOmywlwSPEWwhnf2Q Onm+wP0Yat6+1njap0uU5NkrooJ2BRqlZoQwMcDnVa71HNmsvw0vzTCEPwg1xRTg AfDga4ScQ9u5U426+YWyn3R2DNCdBf23f1iox1iJnE8FFKfpNeyulf2NuZ7rU01M 7KUf0D80pTSA5wFM2SG+FOBXAZjqJvM+FMjOEbwkE4kc7Q+JCppHDkEmJR/A8xfs USM0DVHKn/A3GixAoF3TB1bcNhYKYTK9pMwY6FS6BRP5t89w+z8tPoQWbZy/hFOM hP9koj47pI78b47VR5ed+PCh5swOSGPr/lx6QdriEi+2DfVZrrPWQSKtPpJylNKH jzgnNA/um+4hEht6DG9+/WSdOOCq+a+tgJYKizGCvvJUiNMgiZE7Oge/t+0GggHB S4vThVIGGl9UondcKwuOAErPyH1sGJoqa8fnjTCYQ+yHVudVEDpBcl2WtXJS3waC O1nVNAC9FRxgIztb5B5ff5VekIVF4lOcyE+s3A0P/xkywEYAKuUQswtSuXI1unPH t74KOebAcc7335e71gvpET0uQmCUtTqGFjXJ0l5QsluCjL2qgpo= =1YZx -----END PGP SIGNATURE----- --=-=-=--