From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: Goals for 0.4 Date: Sat, 31 Aug 2013 20:05:45 +0200 Message-ID: <87bo4dspl2.fsf@gnu.org> References: <87vc2o4qwc.fsf@gnu.org> <87y57kljro.fsf@karetnikov.org> <87hae81uvo.fsf@gnu.org> <87bo4fcbcz.fsf@karetnikov.org> <878uzj6nev.fsf@gnu.org> <877gf1yftq.fsf@karetnikov.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60342) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VFpdP-0007Lj-Ur for guix-devel@gnu.org; Sat, 31 Aug 2013 14:11:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VFpdL-0003HS-KU for guix-devel@gnu.org; Sat, 31 Aug 2013 14:10:55 -0400 In-Reply-To: <877gf1yftq.fsf@karetnikov.org> (Nikita Karetnikov's message of "Sat, 31 Aug 2013 20:40:01 +0400") List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Nikita Karetnikov Cc: guix-devel@gnu.org, "Jose E. Marchesi" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable (Cc=E2=80=99ing Jos=C3=A9 or recutils.) Jos=C3=A9: this is about providing a way to list the =E2=80=9Cgenerations= =E2=80=9D of a profile, i.e., the packages that were installed at a given point in time. Nikita Karetnikov skribis: >> Rather, I would do: > >> --delete-generations=3D3..9 > >> It=E2=80=99s easier to parse and to type. > >> Likewise, it could even support: > >> --delete-generations=3D1month > > Here=E2=80=99s what I decided to use: > > --list-generations > --list-generations=3D10 > --list-generations=3D1,32,9 > --list-generations=3D4..10 > --list-generations=3D11.. > --list-generations=3D..13 > --list-generations=3Dfirst-month > --list-generations=3Dlast-month > > I guess I have to write a parser for the =E2=80=9C1,32,9=E2=80=9D case, r= ight? Or is > there a simpler solution? > >> Perhaps there could be several formats. For instance, >> --list-generations would be equivalent to --list-generations=3Dshort: > >> generation 1 Dec. 16 2013 >> generation 2 May 7 2013 > >> And then --list-generations=3Dlong 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 =E2=80=98--short=E2=80=99 switch or a new > =E2=80=98--list-generations-short=E2=80=99 option? Both solutions look u= gly. I just realized that we can do even better: have --list-generations output recutils-formatted data (using =E2=80=98object->fields=E2=80=99). T= hen, if we do it right, the output can just be piped to =E2=80=98recsel=E2=80=99 to selec= t entries of a certain age, to display specific fields, etc. Like: generation-number: 1 date: 2013-05-07 However, I don=E2=80=99t know exactly how to represent both the generations= and the list of packages in each generation in a single recutils stream. Jos=C3=A9, how can the relations between =E2=80=9Cgeneration=E2=80=9D recor= ds and =E2=80=9Cpackage=E2=80=9D records be expressed? >> I=E2=80=99ll have to disagree. :-) > >> There=E2=80=99s no such verb as =E2=80=9Crollback=E2=80=9D, I think, whe= reas =E2=80=9Cfallback=E2=80=9D is a >> valid noun (and we don=E2=80=99t have the choice for =E2=80=9Cfallback= =E2=80=9D, since there are >> messages in the daemon that mention it.) > >> Now, if you had --rollback as an alias, I won=E2=80=99t scream either... > > See [1=E2=80=934]. Would you like to keep =E2=80=98--roll-back=E2=80=99 = 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=E2=80=99s just do this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline 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 --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable and perhaps we can document both in the manual. Ludo=E2=80=99. --=-=-=--