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: Show which generation is the current one. Date: Tue, 24 Sep 2013 14:45:58 +0200 Message-ID: <8761tqbd6h.fsf@gnu.org> References: <87vc2o4qwc.fsf@gnu.org> <87y57kljro.fsf@karetnikov.org> <87hae81uvo.fsf@gnu.org> <87li2oslzh.fsf_-_@karetnikov.org> <87hadcr4sh.fsf_-_@karetnikov.org> <8738ow5zif.fsf@gnu.org> <87vc1r6nu0.fsf@karetnikov.org> <87ob7izrsp.fsf_-_@karetnikov.org> 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]:41048) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOS56-0002re-7j for guix-devel@gnu.org; Tue, 24 Sep 2013 08:51:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VOS4y-0006cL-Dv for guix-devel@gnu.org; Tue, 24 Sep 2013 08:51:08 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:57037) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VOS4y-0006cH-7S for guix-devel@gnu.org; Tue, 24 Sep 2013 08:51:00 -0400 In-Reply-To: <87ob7izrsp.fsf_-_@karetnikov.org> (Nikita Karetnikov's message of "Tue, 24 Sep 2013 09:56:22 +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: Nikita Karetnikov Cc: guix-devel@gnu.org Nikita Karetnikov skribis: > Will these lines be i18n=E2=80=99d? I fail to configure the locales prop= erly, > so I can=E2=80=99t check. > > + (format #t "~a\t(current)~%" header) > + (format #t "~a~%" header))) Change the first one to: (format #t (_ "~a\t(current)~%") header) That will internationalize it. > From 7759ad3ad89d236e766639c0875540e60a503d16 Mon Sep 17 00:00:00 2001 > From: Nikita Karetnikov > Date: Tue, 24 Sep 2013 05:41:32 +0000 > Subject: [PATCH] guix package: Show which generation is the current one. > > * guix/scripts/package.scm (guix-package)[process-query]: Show that a > generation is the current one if the profile points to it. > * tests/guix-package.sh: Test it. > --- > guix/scripts/package.scm | 17 ++++++++++++----- > tests/guix-package.sh | 3 +++ > 2 files changed, 15 insertions(+), 5 deletions(-) > > diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm > index 9ed499d..a8dfcbc 100644 > --- a/guix/scripts/package.scm > +++ b/guix/scripts/package.scm > @@ -955,13 +955,20 @@ more information.~%")) > (match (assoc-ref opts 'query) > (('list-generations pattern) > (define (list-generation number) > + (define (current-generation? number) > + (let ((generation (format #f "~a-~a-link" profile number))) > + (string=3D? (readlink profile) generation))) Could we instead of a global (current-generation-number profile) procedure? We=E2=80=99d store the number in a local variable here, to avoid repeated =E2=80=98readlink=E2=80=99 calls. Other than that I=E2=80=99m fine with the patch. Thanks, Ludo=E2=80=99.