GNU bug report logs -
#29847
[PATCH] import: pypi: Stay in the REPL if fail to get a source
Previous Next
Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>
Date: Mon, 25 Dec 2017 13:49:02 UTC
Severity: normal
Tags: patch
Done: ludo <at> gnu.org (Ludovic Courtès)
Bug is archived. No further changes may be made.
Full log
Message #23 received at 29847 <at> debbugs.gnu.org (full text, mbox):
Ping!
ludo <at> gnu.org (Ludovic Courtès) skribis:
> Hi Oleg,
>
> Oleg Pykhalov <go.wigust <at> gmail.com> 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’.
This bug report was last modified 7 years and 56 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.