From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id IGeBEApGrmK8bAEAbAwnHQ (envelope-from ) for ; Sat, 18 Jun 2022 23:39:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yLqzDwpGrmK4xAAAG6o9tA (envelope-from ) for ; Sat, 18 Jun 2022 23:39:22 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E472F6A82 for ; Sat, 18 Jun 2022 23:39:21 +0200 (CEST) Received: from localhost ([::1]:39838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o2gA5-0005sJ-2w for larch@yhetil.org; Sat, 18 Jun 2022 17:39:21 -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 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: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1655588362; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=kOrUXQ7Z8s/HeG6itWK3lXB0Vi+vJNd8r7NpAp1xodM=; b=V5gY4e3jJFZd2t0lTcbLkzir0PIEEynfsgDRByNgDOYK7luc/sGDTvG43QXHx4RGZUCdHe cvsYzo1NFlKr7rCKKMNEwbWpDDnpBREzfUeW+K/eqmUtvexmzLWMdwX40PXZr811GtIGol MAyrM4vC9jZANBJhsejrWqCXCZ9+DTE7SyOyaDpRb/vrRJIqzoZvb+z0lrIBuPOm1+/MXi pEJmZ7xbvb7ObR6Lc4LhIi5TrnpI/MgIY/GRRjltihAGCQa5nBPT8d2jp+u54jRQwbKO89 YWlorxkZfsoV40Fy4emBIIH+DA8lPGJTqQVZNhy6NAFTE6AKWDWwTOE6Bs6wbA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1655588362; a=rsa-sha256; cv=none; b=dZ71i2byP8wH8+jwOTigkn6eJGke/af2pP3kb4Vb2ExwLc4tknzfEu+oTGRT/MzzKLfUdf Pwetwtl4/CnjBbTz3BBdMTP0leSmRhi91vShCHjm5HJR1FbrUOHpYJXf136oDGBdPC2bIu mLll2L7T+jNVP6gBzh3s/ZM1u0RGG1AjXGJJeFgCzHtWTKnJGuoA3fVFsnJGqG2wSPPVua LmpoM3tctabFAEycjOMmOG1xGp5kL/tXvgWg3lev1Exi50PCmYPxPdUdqyd5NjpQ5LHC2a 7FyGMcPsiAfSjcDQGpE67OX2hBbBy/B6o+kItbt/J0ohoLyYtkiNMXmV8gACaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=JcLas+03; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.09 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=JcLas+03; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E472F6A82 X-Spam-Score: -4.09 X-Migadu-Scanner: scn0.migadu.com X-TUID: p0vBJo4F5TRZ 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) -- 2.36.1