From patchwork Wed Jun 9 13:04:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 156 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3436027BC81; Wed, 9 Jun 2021 14:05:19 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B2C4D27BC78 for ; Wed, 9 Jun 2021 14:05:18 +0100 (BST) Received: from localhost ([::1]:36614 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lqxtU-0000ZT-Cv for patchwork@mira.cbaines.net; Wed, 09 Jun 2021 09:05:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52084) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqxtH-0000Z6-FA for guix-patches@gnu.org; Wed, 09 Jun 2021 09:05:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49210) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lqxtG-00067P-93 for guix-patches@gnu.org; Wed, 09 Jun 2021 09:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lqxtG-00027o-3O for guix-patches@gnu.org; Wed, 09 Jun 2021 09:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48934] [PATCH 0/2] Some improvements to (gnu services configuration) Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 09 Jun 2021 13:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48934 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48934@debbugs.gnu.org Cc: Maxim Cournoyer X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16232438838115 (code B ref -1); Wed, 09 Jun 2021 13:05:01 +0000 Received: (at submit) by debbugs.gnu.org; 9 Jun 2021 13:04:43 +0000 Received: from localhost ([127.0.0.1]:60748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqxsx-00026o-BV for submit@debbugs.gnu.org; Wed, 09 Jun 2021 09:04:43 -0400 Received: from lists.gnu.org ([209.51.188.17]:52342) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lqxst-00026d-Eh for submit@debbugs.gnu.org; Wed, 09 Jun 2021 09:04:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqxst-0000YO-82 for guix-patches@gnu.org; Wed, 09 Jun 2021 09:04:39 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:52852 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lqxsr-0005pu-7I for guix-patches@gnu.org; Wed, 09 Jun 2021 09:04:38 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1623243872; bh=5bBQE6rjKvTSx1/b3G8AEr8RCXtymh5IyYWIVfpszpc=; h=From:To:Cc:Subject:Date; b=pnLkIzSETXg0nSCgxedHt/9MKgVAPPk7DmsMe/xJtch+iWADLCbRp8UVn1ZP0rv0e 0Qn2Ot2/HQbzLuWWuqlXkfXtnL+ipEsb4L/kmQSUncHJqv6lVQl0df3ZJHNVsdwwAf BraShKg1SDUZQYwvE3Kvti5x/0fx1QEquYV7aayA= Message-Id: Date: Wed, 09 Jun 2021 15:04:31 +0200 MIME-Version: 1.0 Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 30 X-Spam_score: 3.0 X-Spam_bar: +++ X-Spam_report: (3.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.498, FROM_SUSPICIOUS_NTLD_FP=1.597, PDS_OTHER_BAD_TLD=1.997, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This series contains some improvements to the (gnu services configuration) module. The first patch changes the formatting of the generated documentation for configuration records. Previously, the generated documentation looked a bit different from the ones that were to generated, compare the docs for ‘getmail-configuration’ (generated) and ‘openssh-configuration’ (not generated). --8<---------------cut here---------------start------------->8--- Available ‘getmail-configuration’ fields are: -- ‘getmail-configuration’ parameter: symbol name A symbol to identify the getmail service. Defaults to ‘"unset"’. -- ‘getmail-configuration’ parameter: package package The getmail package to use. --8<---------------cut here---------------end--------------->8--- --8<---------------cut here---------------start------------->8--- -- Data Type: openssh-configuration This is the configuration record for OpenSSH’s ‘sshd’. ‘openssh’ (default OPENSSH) The Openssh package to use. ‘pid-file’ (default: ‘"/var/run/sshd.pid"’) Name of the file where ‘sshd’ writes its PID. ‘port-number’ (default: ‘22’) TCP port on which ‘sshd’ listens for incoming connections. --8<---------------cut here---------------end--------------->8--- The first patch will make the generated documentation look at lot more similiar to the hand-written ones. --8<---------------cut here---------------start------------->8--- -- Data Type: getmail-configuration Available ‘getmail-configuration’ fields are: ‘name’ (default: ‘"unset"’) (type: symbol) A symbol to identify the getmail service. ‘package’ (default: ‘getmail’) (type: package) The getmail package to use. --8<---------------cut here---------------end--------------->8--- If you paid close attention you will also notice that the old generated docs didn’t specify the default value of the ‘package’ field, whereas the new docs do. This brings us to the second patch, it looks the package and shows the value of the ‘name’ field of the package. This will only show the correct package name if the ‘name’ field and the Scheme variable corresponding to the package are the same, in most cases it is, so I don’t think it would be a huge deal. Xinglu Chen (2): services: configuration: Change formatting of generated documentation. services: configuration: Show default value when it is a package. gnu/services/configuration.scm | 62 ++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 26 deletions(-) base-commit: 86bb77608d375043f837583332a7c852ea2080ec