From debbugs-submit-bounces@debbugs.gnu.org Thu Jun 16 17:12:04 2022 Received: (at 55659) by debbugs.gnu.org; 16 Jun 2022 21:12:04 +0000 Received: from localhost ([127.0.0.1]:43209 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1wmY-0004Yl-0X for submit@debbugs.gnu.org; Thu, 16 Jun 2022 17:12:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57062) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o1wmS-0004YR-UP for 55659@debbugs.gnu.org; Thu, 16 Jun 2022 17:12:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50322) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1wmM-0000QT-FR; Thu, 16 Jun 2022 17:11:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=tms1joojyKbZVGWAFmXmivD/rN5T122fWsN4rRlJFx4=; b=ZmuJJlUroKxO5fdZKq6N wihu1vGIAB8BTlFQ8gYBRIT/fowhABJlrmKNef7GliuvGseSx+BxsrCltPVK/v49sW46Q7k0K7Fwl GFaOTPNpmpNumSAb3CNlDteRgjUj7b2xAQgPoaa5nEuyyCK9UtzU+HynBmMc0LWaTdXb/W8ab0qtv v6gPcQVdpisGgn3tUXJinQAp/sxl1fSogZifkz3/R93NCHw53m2q2hXc8nCrbymD4j2xlOo09sxS6 YhIVxBMtyVGNuhoZU4q9RbBTXJ+YWHLRMpITujvZaTCJzoyGhSc/8brrs6K2VVa3YYrQ0pgLfA1my TtGwdVAN/gUq1Q==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:60958 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o1wmM-0001Np-0W; Thu, 16 Jun 2022 17:11:50 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Attila Lendvai Subject: Re: bug#55659: [PATCH 1/2] services: ddclient: Fix extra-options serialization. References: <20220526130912.29483-1-attila@lendvai.name> Date: Thu, 16 Jun 2022 23:11:47 +0200 In-Reply-To: <20220526130912.29483-1-attila@lendvai.name> (Attila Lendvai's message of "Thu, 26 May 2022 15:09:12 +0200") Message-ID: <87mtecjoto.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 55659 Cc: 55659@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Attila Lendvai skribis: > Prior to this fix it has serialized "extra-options=3D..." into the ddclie= nt.conf > file. [...] > (define (serialize-field field-name val) > - (when (not (member field-name '(group secret-file user))) > - (format #t "~a=3D~a\n" (uglify-field-name field-name) val))) > + (cond > + ((eq? field-name 'extra-options) > + (display val)) > + ((not (member field-name '(group secret-file user))) > + (format #t "~a=3D~a\n" (uglify-field-name field-name) val)))) >=20=20 > (define (serialize-boolean field-name val) > (serialize-field field-name (if val "yes" "no"))) > @@ -921,9 +924,6 @@ (define (serialize-string field-name val) > (define (serialize-list field-name val) > (if (null? val) "" (serialize-field field-name (string-join val)))) >=20=20 > -(define (serialize-extra-options extra-options) > - (string-join extra-options "\n" 'suffix)) > - > (define-configuration ddclient-configuration > (ddclient > (file-like ddclient) > @@ -959,8 +959,8 @@ (define-configuration ddclient-configuration > file contains credentials for use by ddclient. You are expected to crea= te it > manually.") > (extra-options > - (list '()) > - "Extra options will be appended to @file{ddclient.conf} file.")) > + (string "") > + "Extra options will be appended verbatim to the @file{ddclient.conf} = file.")) In other places, such as (gnu home services desktop), I=E2=80=99ve used an = extra =E2=80=98raw-configuration-string=E2=80=99 field type to handle this cases.= This might be clearer than adding the =E2=80=98cond=E2=80=99 above in =E2=80=98seriali= ze-field=E2=80=99. WDYT? The change above also changes the interface (from list to string), but I think that=E2=80=99s OK. Thanks, Ludo=E2=80=99.