From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39848) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f60O2-0007qZ-0H for guix-patches@gnu.org; Tue, 10 Apr 2018 17:01:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f60Ny-0000N0-42 for guix-patches@gnu.org; Tue, 10 Apr 2018 17:01:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:37579) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f60Ny-0000Mw-0y for guix-patches@gnu.org; Tue, 10 Apr 2018 17:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f60Nx-0002qT-Pm for guix-patches@gnu.org; Tue, 10 Apr 2018 17:01:01 -0400 Subject: [bug#31089] [PATCH 4/5] services: cgit: Enforce serialization order. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-4-clement@lassieur.org> Date: Tue, 10 Apr 2018 23:00:22 +0200 In-Reply-To: <20180407170709.22160-4-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:08 +0200") Message-ID: <87muya6al5.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur Cc: 31089@debbugs.gnu.org Cl=C3=A9ment Lassieur skribis: > This distinguishes fields whose order matters, and makes sure further cha= nges > won't inadvertently change the order. > > * gnu/services/cgit.scm (serialize-cgit-configuration): New procedure that > serializes fields with a precise order. > (cgit-activation): Replace the generic SERIALIZE-CONFIGURATION with > SERIALIZE-CGIT-CONFIGURATION. > --- > gnu/services/cgit.scm | 13 ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) > > diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm > index 98e46e0b8..f53306cd3 100644 > --- a/gnu/services/cgit.scm > +++ b/gnu/services/cgit.scm > @@ -631,6 +631,17 @@ for cgit to allow access to that repository.") > (list '()) > "Extra options will be appended to cgitrc file.")) >=20=20 > +(define (serialize-cgit-configuration config) > + (define (rest? field) > + (not (memq (configuration-field-name field) > + '(repositories)))) > + #~(string-append > + #$(let ((rest (filter rest? cgit-configuration-fields))) > + (serialize-configuration config rest)) > + #$(serialize-repository-cgit-configuration-list > + 'repositories > + (cgit-configuration-repositories config)))) Please add a comment here explaining the story about field ordering. OK with this change! Ludo=E2=80=99.