bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: guix-package --roll-back


From: Ludovic Courtès
Subject: Re: guix-package --roll-back
Date: Sun, 13 Jan 2013 21:40:58 +0100
User-agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux)

Nikita Karetnikov <address@hidden> skribis:

>> It actually does, but it has no side effect.
>
> I know that printing is a side effect.  Why do you recommend to use
> 'alist-cons'?  If it's not possible to display anything, then
> 'roll-back' won't be able to print the following messages.

It’s just the /option handler/ (the procedure passed to SRFI-37
‘option’) that should not print anything.  It is then OK to print
things, of course, like is done for other options.

Check how the other options are handled: during ‘args-fold’, the option
handler just adds to RESULT an element saying that this option was
passed.  Once ‘args-fold’ has completed, we check its result: if it
contains a pair whose key is ‘install’, then it means we want to install
something, and so on.

>> When ‘--profile’ is passed, the result of ‘parse-options’ contains a
>> pair whose key is ‘profile’.  The (assoc-ref opts 'profile) calls that
>> you see retrieve the argument given to ‘--profile’.
>
> It's clear.  But where should I call (assoc-ref opts 'profile)?  Should
> I do it in 'process-query'?

In ‘process-actions’ more precisely, because roll-back is an action, not
a query.  And ‘process-actions’ already does that.

HTH,
Ludo’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]