From patchwork Sat Jun 18 21:38:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 40142 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 A3C8427BBEA; Sat, 18 Jun 2022 22:39:21 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=unavailable 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 0F94827BBE9 for ; Sat, 18 Jun 2022 22:39:21 +0100 (BST) Received: from localhost ([::1]:39838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2gA4-0005sJ-7c for patchwork@mira.cbaines.net; Sat, 18 Jun 2022 17:39:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2g9m-0005rt-Ay for guix-patches@gnu.org; Sat, 18 Jun 2022 17:39:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:56390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2g9m-0006iu-39 for guix-patches@gnu.org; Sat, 18 Jun 2022 17:39:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o2g9m-0004Wq-1C for guix-patches@gnu.org; Sat, 18 Jun 2022 17:39:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56075] [PATCH 2/2] services: configuration: Remove 'validate-configuration'. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 18 Jun 2022 21:39:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56075 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56075@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 56075-submit@debbugs.gnu.org id=B56075.165558832817380 (code B ref 56075); Sat, 18 Jun 2022 21:39:01 +0000 Received: (at 56075) by debbugs.gnu.org; 18 Jun 2022 21:38:48 +0000 Received: from localhost ([127.0.0.1]:50286 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2g9Y-0004WB-Eb for submit@debbugs.gnu.org; Sat, 18 Jun 2022 17:38:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35240) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o2g9W-0004Vo-Th for 56075@debbugs.gnu.org; Sat, 18 Jun 2022 17:38:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:45072) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o2g9R-0006fc-MM; Sat, 18 Jun 2022 17:38:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=kOrUXQ7Z8s/HeG6itWK3lXB0Vi+vJNd8r7NpAp1xodM=; b=JcLas+03Oy7sCKLB5ybx YVhRdxI5tEJjuXK2ZWKWVLUi0on8MasGXuLDaBKPFuy0wyIFGUzoBHeAThL8pMKoRR7ptUPUtf0Fh 84rWIdE4TZilkvx0y4B5Me3VDBtfFvRIDHLl72dnhBL8C4eoUZS+V14vEzT23SnPSaIfu6Jn+lNr2 qP2/67iPOSo1BDt5Qy9ai+Pw4mQJmoIV/Qnlcbrw8VMD91XnMKfeu4oFQKpGqF1RDKTsXuaj9f8Fs RXNxLrhlQnXUNQ86w1xsiptPZhayxJ/DN/TdGH0bxiCWJ0eMFfjCw1/9xzjCJmThfXXHKXpLJjBB/ xxvgVbsoZ23nKg==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:58587 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o2g9R-00054e-A8; Sat, 18 Jun 2022 17:38:41 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sat, 18 Jun 2022 23:38:32 +0200 Message-Id: <20220618213832.25165-2-ludo@gnu.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220618213832.25165-1-ludo@gnu.org> References: <20220618213832.25165-1-ludo@gnu.org> MIME-Version: 1.0 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 Now that configuration records use the 'sanitize' property for each field, 'validate-configuration' has become useless because it's impossible to construct an invalid configuration record. * gnu/services/configuration.scm (validate-configuration): Remove. * gnu/services/mail.scm (dovecot-service): Remove call. * gnu/services/vpn.scm (openvpn-client-service) (openvpn-server-service): Likewise. * doc/guix.texi (Complex Configurations): Remove documentation. --- doc/guix.texi | 6 ------ gnu/services/configuration.scm | 9 --------- gnu/services/mail.scm | 4 ---- gnu/services/vpn.scm | 2 -- 4 files changed, 21 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index 86348fc02c..45f2620476 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -38886,12 +38886,6 @@ Return a G-expression that contains the values corresponding to the disk by using something like @code{mixed-text-file}. @end deffn -@deffn {Scheme Procedure} validate-configuration @var{configuration} -@var{fields} -Type-check @var{fields}, a list of field names of @var{configuration}, a -configuration record created by @code{define-configuration}. -@end deffn - @deffn {Scheme Procedure} empty-serializer @var{field-name} @var{value} A serializer that just returns an empty string. The @code{serialize-package} procedure is an alias for this. diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index c39ea5a02a..e3c101d042 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -57,7 +57,6 @@ (define-module (gnu services configuration) serialize-configuration define-maybe define-maybe/no-serialization - validate-configuration generate-documentation configuration->documentation empty-serializer @@ -125,14 +124,6 @@ (define (serialize-configuration config fields) ((configuration-field-getter field) config))) fields))) -(define (validate-configuration config fields) - (for-each (lambda (field) - (let ((val ((configuration-field-getter field) config))) - (unless ((configuration-field-predicate field) val) - (configuration-field-error - (configuration-field-name field) val)))) - fields)) - (define-syntax-rule (id ctx parts ...) "Assemble PARTS into a raw (unhygienic) identifier." (datum->syntax ctx (symbol-append (syntax->datum parts) ...))) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index c2fd4d8670..10e6523861 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -1610,10 +1610,6 @@ (define* (dovecot-service #:key (config (dovecot-configuration))) by @code{dovecot-configuration}. @var{config} may also be created by @code{opaque-dovecot-configuration}, which allows specification of the @code{dovecot.conf} as a string." - (validate-configuration config - (if (opaque-dovecot-configuration? config) - opaque-dovecot-configuration-fields - dovecot-configuration-fields)) (service dovecot-service-type config)) ;; A little helper to make it easier to document all those fields. diff --git a/gnu/services/vpn.scm b/gnu/services/vpn.scm index 8be632d55f..ec9ef6b6f0 100644 --- a/gnu/services/vpn.scm +++ b/gnu/services/vpn.scm @@ -540,11 +540,9 @@ (define openvpn-client-service-type to an existing @acronym{VPN, virtual private network}."))) (define* (openvpn-client-service #:key (config (openvpn-client-configuration))) - (validate-configuration config openvpn-client-configuration-fields) (service openvpn-client-service-type config)) (define* (openvpn-server-service #:key (config (openvpn-server-configuration))) - (validate-configuration config openvpn-server-configuration-fields) (service openvpn-server-service-type config)) (define (generate-openvpn-server-documentation)