Message ID | E1gZig9-0005Q1-Me@rmmprod05.runbox |
---|---|
State | Accepted |
Headers | show |
Series | [bug#33806] system: 'kernel->boot-label' now accepts inferior packages. | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | fail | Apply failed |
Hello, <pkill9@runbox.com> skribis: > From 6c0bbaa0a73f4c6043211df6af100877dc9a4094 Mon Sep 17 00:00:00 2001 > From: Pkill -9 <pkill9@runbox.com> > Date: Wed, 19 Dec 2018 20:22:20 +0000 > Subject: [PATCH] system: 'kernel->boot-label' now accepts inferior packages. > > * gnu/system.scm (kernel->boot-label): Get package name and version > using the functions for inferior packages if the kernel is not a > regular package. [...] > (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)")) > + (if (package? kernel) > + (string-append "GNU with " > + (string-titlecase (package-name kernel)) " " > + (package-version kernel) > + " (beta)") > + (string-append "GNU with " > + (string-titlecase (inferior-package-name kernel)) > + (inferior-package-version kernel) > + " (beta)"))) I’d suggest writing it as: (cond ((package? kernel) …) ((inferior-package? kernel) …) (else "GNU")) Could you send an updated patch? Of course this is also where we start wondering whether <package> and <inferior-package> should simply inherit from a common class of which ‘package-name’ would be a method… In this case I think it’s OK to do things this way, especially because the kernel could also be a non-package file-like object. Thanks, Ludo’.
From 6c0bbaa0a73f4c6043211df6af100877dc9a4094 Mon Sep 17 00:00:00 2001 From: Pkill -9 <pkill9@runbox.com> Date: Wed, 19 Dec 2018 20:22:20 +0000 Subject: [PATCH] system: 'kernel->boot-label' now accepts inferior packages. * gnu/system.scm (kernel->boot-label): Get package name and version using the functions for inferior packages if the kernel is not a regular package. --- gnu/system.scm | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/gnu/system.scm b/gnu/system.scm index a5a8f40d6..afe39278d 100644 --- a/gnu/system.scm +++ b/gnu/system.scm @@ -21,6 +21,7 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (gnu system) + #:use-module (guix inferior) #:use-module (guix store) #:use-module (guix monads) #:use-module (guix gexp) @@ -905,10 +906,15 @@ listed in OS. The C library expects to find it under (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)")) + (if (package? kernel) + (string-append "GNU with " + (string-titlecase (package-name kernel)) " " + (package-version kernel) + " (beta)") + (string-append "GNU with " + (string-titlecase (inferior-package-name kernel)) + (inferior-package-version kernel) + " (beta)"))) (define (store-file-system file-systems) "Return the file system object among FILE-SYSTEMS that contains the store." -- 2.19.2