From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55461) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gZjpz-0001oa-Ao for guix-patches@gnu.org; Wed, 19 Dec 2018 16:57:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gZjpw-0000xq-On for guix-patches@gnu.org; Wed, 19 Dec 2018 16:57:07 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:50924) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gZjpt-0000uB-Pp for guix-patches@gnu.org; Wed, 19 Dec 2018 16:57:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gZjpt-0004xw-Km for guix-patches@gnu.org; Wed, 19 Dec 2018 16:57:01 -0500 Subject: [bug#33806] [PATCH] system: 'kernel->boot-label' now accepts inferior packages. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Wed, 19 Dec 2018 22:56:08 +0100 In-Reply-To: (pkill9's message of "Wed, 19 Dec 2018 20:42:53 +0000 (GMT)") Message-ID: <87zht1rxjb.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: pkill9@runbox.com Cc: 33806@debbugs.gnu.org Hello, skribis: > From 6c0bbaa0a73f4c6043211df6af100877dc9a4094 Mon Sep 17 00:00:00 2001 > From: Pkill -9 > Date: Wed, 19 Dec 2018 20:22:20 +0000 > Subject: [PATCH] system: 'kernel->boot-label' now accepts inferior packag= es. > > * 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=E2=80=99d suggest writing it as: (cond ((package? kernel) =E2=80=A6) ((inferior-package? kernel) =E2=80=A6) (else "GNU")) Could you send an updated patch? Of course this is also where we start wondering whether and should simply inherit from a common class of which =E2=80=98package-name=E2=80=99 would be a method=E2=80=A6 In this case I think it=E2=80=99s OK to do things this way, especially beca= use the kernel could also be a non-package file-like object. Thanks, Ludo=E2=80=99.