guix-devel
[Top][All Lists]
Advanced

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

Re: Goals for 0.4


From: Ludovic Courtès
Subject: Re: Goals for 0.4
Date: Sat, 31 Aug 2013 20:05:45 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

(Cc’ing José or recutils.)

José: this is about providing a way to list the “generations” of a
profile, i.e., the packages that were installed at a given point in
time.

Nikita Karetnikov <address@hidden> skribis:

>> Rather, I would do:
>
>>   --delete-generations=3..9
>
>> It’s easier to parse and to type.
>
>> Likewise, it could even support:
>
>>   --delete-generations=1month
>
> Here’s what I decided to use:
>
> --list-generations
> --list-generations=10
> --list-generations=1,32,9
> --list-generations=4..10
> --list-generations=11..
> --list-generations=..13
> --list-generations=first-month
> --list-generations=last-month
>
> I guess I have to write a parser for the “1,32,9” case, right?  Or is
> there a simpler solution?
>
>> Perhaps there could be several formats.  For instance,
>> --list-generations would be equivalent to --list-generations=short:
>
>>   generation 1     Dec. 16 2013
>>   generation 2     May 7 2013
>
>> And then --list-generations=long would do something like:
>
>>   generation 1          Dec. 16 2013
>>     guile    2.0.7 out,debug    gnu/packages/guile.scm
>>     hello    2.8   out          gnu/packages/base.scm
>
>>   generation 2     May 7 2013
>>     guile    2.0.9 out          gnu/packages/guile.scm
>
>> WDYT?
>
> OK, but how can I integrate this in the above scheme?  Will it be OK to
> create an additional ‘--short’ switch or a new
> ‘--list-generations-short’ option?  Both solutions look ugly.

I just realized that we can do even better: have --list-generations
output recutils-formatted data (using ‘object->fields’).  Then, if we do
it right, the output can just be piped to ‘recsel’ to select entries of
a certain age, to display specific fields, etc.  Like:

  generation-number: 1
  date: 2013-05-07

However, I don’t know exactly how to represent both the generations and
the list of packages in each generation in a single recutils stream.

José, how can the relations between “generation” records and “package”
records be expressed?

>> I’ll have to disagree.  :-)
>
>> There’s no such verb as “rollback”, I think, whereas “fallback” is a
>> valid noun (and we don’t have the choice for “fallback”, since there are
>> messages in the daemon that mention it.)
>
>> Now, if you had --rollback as an alias, I won’t scream either...
>
> See [1–4].  Would you like to keep ‘--roll-back’ anyway?
>
> [1] https://en.wiktionary.org/wiki/rollback
> [2] http://www.merriam-webster.com/dictionary/rollback
> [3] http://www.thefreedictionary.com/rollback
> [4] http://oxforddictionaries.com/us/definition/american_english/rollback

OK, let’s just do this:

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 5c3947d..1c9898f 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -497,7 +497,7 @@ Install, remove, or upgrade PACKAGES in a single 
transaction.\n"))
         (option '(#\u "upgrade") #f #t
                 (lambda (opt name arg result)
                   (alist-cons 'upgrade arg result)))
-        (option '("roll-back") #f #f
+        (option '("roll-back" "rollback") #f #f
                 (lambda (opt name arg result)
                   (alist-cons 'roll-back? #t result)))
         (option '("search-paths") #f #f
and perhaps we can document both in the manual.

Ludo’.

reply via email to

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