Message ID | 11414ae2650cde429b82aa168041e3989cf7d84c.1672951913.git.mirai@makinata.eu |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 10BCA27BBED; Thu, 5 Jan 2023 21:15:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C1FDC27BBE9 for <patchwork@mira.cbaines.net>; Thu, 5 Jan 2023 21:15:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1pDXa9-0002Un-7L; Thu, 05 Jan 2023 16:15:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pDXZn-0002QO-HG for guix-patches@gnu.org; Thu, 05 Jan 2023 16:15:05 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pDXZm-0002Iq-OT for guix-patches@gnu.org; Thu, 05 Jan 2023 16:15:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pDXZm-0005Gc-HN for guix-patches@gnu.org; Thu, 05 Jan 2023 16:15:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60582] [PATCH 1/2] services: configuration: Format a list of packages by their names. Resent-From: Bruno Victal <mirai@makinata.eu> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 05 Jan 2023 21:15:02 +0000 Resent-Message-ID: <handler.60582.B60582.167295328120199@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60582 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60582@debbugs.gnu.org Cc: Bruno Victal <mirai@makinata.eu> Received: via spool by 60582-submit@debbugs.gnu.org id=B60582.167295328120199 (code B ref 60582); Thu, 05 Jan 2023 21:15:02 +0000 Received: (at 60582) by debbugs.gnu.org; 5 Jan 2023 21:14:41 +0000 Received: from localhost ([127.0.0.1]:53108 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1pDXZR-0005Fj-27 for submit@debbugs.gnu.org; Thu, 05 Jan 2023 16:14:41 -0500 Received: from smtpmciv6.myservices.hosting ([185.26.106.201]:33556) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <mirai@makinata.eu>) id 1pDXZP-0005Fa-Eo for 60582@debbugs.gnu.org; Thu, 05 Jan 2023 16:14:39 -0500 Received: from mail1.netim.hosting (unknown [185.26.106.172]) by smtpmciv6.myservices.hosting (Postfix) with ESMTP id 745D720CE2 for <60582@debbugs.gnu.org>; Thu, 5 Jan 2023 22:14:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail1.netim.hosting (Postfix) with ESMTP id 92DE480098; Thu, 5 Jan 2023 22:06:14 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mail1.netim.hosting Received: from mail1.netim.hosting ([127.0.0.1]) by localhost (mail1-1.netim.hosting [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JdaVGLSQ5m0N; Thu, 5 Jan 2023 22:06:14 +0100 (CET) Received: from guix-nuc.home.arpa (bl9-118-236.dsl.telepac.pt [85.242.118.236]) (Authenticated sender: lumen@makinata.eu) by mail1.netim.hosting (Postfix) with ESMTPSA id 2575480096; Thu, 5 Jan 2023 22:06:14 +0100 (CET) From: Bruno Victal <mirai@makinata.eu> Date: Thu, 5 Jan 2023 21:06:10 +0000 Message-Id: <11414ae2650cde429b82aa168041e3989cf7d84c.1672951913.git.mirai@makinata.eu> X-Mailer: git-send-email 2.38.1 In-Reply-To: <cover.1672951913.git.mirai@makinata.eu> References: <cover.1672951913.git.mirai@makinata.eu> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#60582,1/2] services: configuration: Format a list of packages by their names.
|
|
Commit Message
Bruno Victal
Jan. 5, 2023, 9:06 p.m. UTC
* gnu/services/configuration.scm (generate-documentation): Format a list of packages by their names. --- gnu/services/configuration.scm | 3 +++ 1 file changed, 3 insertions(+)
Comments
Hi, Bruno Victal <mirai@makinata.eu> writes: > * gnu/services/configuration.scm > (generate-documentation): Format a list of packages by their names. > --- > gnu/services/configuration.scm | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm > index 6b0291dc00..16e2380709 100644 > --- a/gnu/services/configuration.scm > +++ b/gnu/services/configuration.scm > @@ -370,6 +370,9 @@ (define (show-default val) > (cond > ((package? val) > (symbol->string (package->symbol val))) > + ((and ((list-of package?) val) (not (null? val))) > + (format #f "(~{~a~^ ~})" > + (map package->symbol val))) The 'and' and (not (null? val)) don't seem to be necessary as in the empty list of packages, it'd produce the same as the else clause below: --8<---------------cut here---------------start------------->8--- scheme@(gnu services configuration)> (format #f "(~{~a~^ ~})" '()) $1 = "()" scheme@(gnu services configuration)> (str '()) $2 = "()" --8<---------------cut here---------------end--------------->8--- > (else (str val)))) > > `(entry (% (heading
On 2023-01-13 20:29, Maxim Cournoyer wrote: > Hi, > > Bruno Victal <mirai@makinata.eu> writes: > >> * gnu/services/configuration.scm >> (generate-documentation): Format a list of packages by their names. >> --- >> gnu/services/configuration.scm | 3 +++ >> 1 file changed, 3 insertions(+) >> >> diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm >> index 6b0291dc00..16e2380709 100644 >> --- a/gnu/services/configuration.scm >> +++ b/gnu/services/configuration.scm >> @@ -370,6 +370,9 @@ (define (show-default val) >> (cond >> ((package? val) >> (symbol->string (package->symbol val))) >> + ((and ((list-of package?) val) (not (null? val))) >> + (format #f "(~{~a~^ ~})" >> + (map package->symbol val))) > > The 'and' and (not (null? val)) don't seem to be necessary as in the > empty list of packages, it'd produce the same as the else clause below: > > --8<---------------cut here---------------start------------->8--- > scheme@(gnu services configuration)> (format #f "(~{~a~^ ~})" '()) > $1 = "()" > scheme@(gnu services configuration)> (str '()) > $2 = "()" > --8<---------------cut here---------------end--------------->8--- > >> (else (str val)))) >> >> `(entry (% (heading > It is necessary for non file-like fields whose default value is '(). Otherwise configuration->documentation will show blank spaces when it should show an empty list. Cheers, Bruno
diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 6b0291dc00..16e2380709 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -370,6 +370,9 @@ (define (show-default val) (cond ((package? val) (symbol->string (package->symbol val))) + ((and ((list-of package?) val) (not (null? val))) + (format #f "(~{~a~^ ~})" + (map package->symbol val))) (else (str val)))) `(entry (% (heading