From mboxrd@z Thu Jan 1 00:00:00 1970 From: cmmarusich@gmail.com Subject: [PATCH 06/10] grub-entries: take a list of numbers on input Date: Fri, 28 Oct 2016 03:07:23 -0700 Message-ID: <20161028100727.1182-7-cmmarusich@gmail.com> References: <20161028100727.1182-1-cmmarusich@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c044m-0004Rs-AE for guix-devel@gnu.org; Fri, 28 Oct 2016 06:07:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c044l-000407-Hl for guix-devel@gnu.org; Fri, 28 Oct 2016 06:07:52 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:33566) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c044l-0003z9-9s for guix-devel@gnu.org; Fri, 28 Oct 2016 06:07:51 -0400 Received: by mail-pf0-x243.google.com with SMTP id i85so872268pfa.0 for ; Fri, 28 Oct 2016 03:07:51 -0700 (PDT) In-Reply-To: <20161028100727.1182-1-cmmarusich@gmail.com> 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" To: guix-devel@gnu.org From: Chris Marusich * guix/scripts/system.scm (grub-entries): Add an optional parameter which allows the caller to limit the grub entries that get returned. --- guix/scripts/system.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index a4f5c7b..2c80c2e 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -366,8 +366,10 @@ it atomically, and then run OS's activation script." (date->string (time-utc->date time) "~Y-~m-~d ~H:~M"))) -(define* (grub-entries #:optional (profile %system-profile)) - "Return a list of 'menu-entry' for the generations of PROFILE." +(define* (grub-entries #:optional (profile %system-profile) + (numbers (generation-numbers profile))) + "Return a list of 'menu-entry' for the generations of PROFILE specified by +NUMBERS, which is a list of generation numbers." (define (system->grub-entry system number time) (unless-file-not-found (let* ((file (string-append system "/parameters")) @@ -395,8 +397,7 @@ it atomically, and then run OS's activation script." kernel-arguments)) (initrd initrd))))) - (let* ((numbers (generation-numbers profile)) - (systems (map (cut generation-file-name profile <>) + (let* ((systems (map (cut generation-file-name profile <>) numbers)) (times (map (lambda (system) (unless-file-not-found -- 2.9.2