From bdc61ff97d26d5d87020d07dfd43c0a552bd3449 Mon Sep 17 00:00:00 2001 From: Pkill -9 Date: Wed, 19 Dec 2018 20:22:20 +0000 Subject: system: 'kernel->boot-label' now accepts inferior packages. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * gnu/system.scm (kernel->boot-label): Get package name and version using the functions for inferior packages if the kernel is an inferior package. Return "GNU" if the kernel is not a package. Signed-off-by: Ludovic Courtès --- gnu/system.scm | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index a5a8f40d66..146af7cf08 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -21,6 +21,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu system) + #:use-module (guix inferior) #:use-module (guix store) #:use-module (guix monads) #:use-module (guix gexp) @@ -905,10 +906,17 @@ (define definitions (define (kernel->boot-label kernel) "Return a label for the bootloader menu entry that boots KERNEL." - (string-append "GNU with " - (string-titlecase (package-name kernel)) " " - (package-version kernel) - " (beta)")) + (cond ((package? kernel) + (string-append "GNU with " + (string-titlecase (package-name kernel)) " " + (package-version kernel) + " (beta)")) + ((inferior-package? kernel) + (string-append "GNU with " + (string-titlecase (inferior-package-name kernel)) + (inferior-package-version kernel) + " (beta)")) + (else "GNU"))) (define (store-file-system file-systems) "Return the file system object among FILE-SYSTEMS that contains the store." -- cgit v1.2.3