[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a sour
From: |
Ludovic Courtès |
Subject: |
[bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source |
Date: |
Thu, 29 Mar 2018 15:16:53 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) |
Ping!
address@hidden (Ludovic Courtès) skribis:
> Hi Oleg,
>
> Oleg Pykhalov <address@hidden> 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 () …) (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 ‘leave’ with ‘warning’.
>
> Note that for me the motivation is not to avoid exiting REPLs since it’s
> easy to avoid anyway. The motivation is rather to make it easier to
> integrate importers in applications other than ‘guix import’: ‘guix
> refresh’ is one of them, but then I’d also like importers/updaters to be
> directly used from ‘guix package’. For that, it’s a good idea to avoid
> calling ‘exit’ on the first occasion, obviously.
>
> Thanks,
> Ludo’.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug#29847] [PATCH] import: pypi: Stay in the REPL if fail to get a source,
Ludovic Courtès <=