From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH] guix package: Add '--switch-generation' option. Date: Mon, 06 Oct 2014 21:27:12 +0200 Message-ID: <87ppe5vw1b.fsf@gnu.org> References: <87k3719v7p.fsf@gmail.com> <87r419fa50.fsf@gnu.org> <87fvho9fqm.fsf@gmail.com> <87a97taixl.fsf@gmail.com> <87sil2rbly.fsf@gnu.org> <87tx5idn7f.fsf_-_@gmail.com> <87egwlkcy1.fsf@gnu.org> <87ppg5el2i.fsf@gmail.com> <87d2c5h4if.fsf@gnu.org> <87lhqsev1d.fsf@gmail.com> <877g2c74xh.fsf@gnu.org> <87ha1gds3w.fsf@gmail.com> <8761hsmxkl.fsf@gnu.org> <87zjf4d1mh.fsf@gmail.com> <87mwb0b3fq.fsf@gnu.org> <87ha17ctyv.fsf_-_@gmail.com> <87ppfs6gxk.fsf@gnu.org> <87wq8fk979.fsf_-_@gmail.com> <87eguninyx.fsf@gnu.org> <8738b1jndu.fsf_-_@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35199) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbDwE-0007LN-KD for guix-devel@gnu.org; Mon, 06 Oct 2014 15:27:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XbDw4-00086o-Vx for guix-devel@gnu.org; Mon, 06 Oct 2014 15:27:17 -0400 Received: from hera.aquilenet.fr ([2a01:474::1]:49085) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XbDw4-00086W-IW for guix-devel@gnu.org; Mon, 06 Oct 2014 15:27:08 -0400 In-Reply-To: <8738b1jndu.fsf_-_@gmail.com> (Alex Kost's message of "Mon, 06 Oct 2014 18:14:53 +0400") List-Id: "Development of GNU Guix and the GNU System distribution." 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: Alex Kost Cc: guix-devel@gnu.org Alex Kost skribis: > A patch is attached. Some comments: > > - =E2=80=98shitted-generation=E2=80=99 is not a very good name, I think. = Ideas? =E2=80=98shifted-generation=E2=80=99 is better :-), but otherwise maybe =E2=80=98relative-generation=E2=80=99? No strong opinion. > - =E2=80=98previous-generation-number=E2=80=99 may use =E2=80=98shifted-g= eneration=E2=80=99 now: > > (define* (previous-generation-number profile #:optional > (number (generation-number profile))) > "Return the number of the generation before generation NUMBER of > PROFILE, or 0 if none exists. It could be NUMBER - 1, but it's not the > case when generations have been deleted (there are \"holes\")." > (or (shifted-generation profile -1 number) > 0)) > > Worth changing? Yes, why not. > - Perhaps it would be better to make 2 commits (?): one for adding > =E2=80=98shifted-generation=E2=80=99 and =E2=80=98switch-to-generation= =E2=80=99 procedures to (guix > profiles) and another is for adding the =E2=80=9C--switch-generation=E2= =80=9D option > itself. Yes. > - Also I made a couple of cosmetic changes in =E2=80=9Cguix/scripts/packa= ge.scm=E2=80=9D: > * =E2=80=98filter-map=E2=80=99 was replaced by 'for-each' because it wa= s called only for > side effects there; > * =E2=80=98begin=E2=80=99 was removed from =E2=80=98cond=E2=80=99. > I think these changes do not deserve a separate commit and may stay in > this patch. Is it OK? Several patches make it easier to reason about the changes, but it=E2=80=99= s OK here. Your call. > From 3cc52d1aade5e9723c38c0af5fa4437cbdf1a9b6 Mon Sep 17 00:00:00 2001 > From: Alex Kost > Date: Mon, 6 Oct 2014 17:35:51 +0400 > Subject: [PATCH] guix package: Add '--switch-generation' option. > > * doc/guix.texi (Invoking guix package): Update documentation. > * guix/profiles.scm (shifted-generation, switch-to-generation): New > procedures. > * guix/scripts/package.scm: Add '--switch-generation' option. > (switch-to-previous-generation): Use 'switch-to-generation'. Could you add a test in tests/guix-package.sh? The rest looks good to me, thanks for working on it! Ludo=E2=80=99.