From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57891) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJd4M-0003bz-GP for guix-patches@gnu.org; Fri, 18 May 2018 06:57:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJd4I-0000BB-I2 for guix-patches@gnu.org; Fri, 18 May 2018 06:57:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:59535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fJd4I-0000B5-D8 for guix-patches@gnu.org; Fri, 18 May 2018 06:57:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fJd4I-0005AJ-5h for guix-patches@gnu.org; Fri, 18 May 2018 06:57:02 -0400 Subject: [bug#31277] [PATCH 2/3] services: cgit: Improve handling of extra-options. Resent-Message-ID: References: <20180426212309.10809-1-mail@cbaines.net> <20180426212309.10809-2-mail@cbaines.net> <87in8bino7.fsf@lassieur.org> From: Christopher Baines In-reply-to: <87in8bino7.fsf@lassieur.org> Date: Fri, 18 May 2018 11:56:44 +0100 Message-ID: <87k1s144gj.fsf@cbaines.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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: 31277@debbugs.gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cl=C3=A9ment Lassieur writes: > Christopher Baines writes: > >> * gnu/services/cgit.scm (serialize-cgit-configuration): Add the extra op= tions, >> one per line, before the scan-path, as this makes it possible to use the >> extra-options to affect the global behaviour for repositories. >> --- >> gnu/services/cgit.scm | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/gnu/services/cgit.scm b/gnu/services/cgit.scm >> index 8ef12cd5a..bacd6ca16 100644 >> --- a/gnu/services/cgit.scm >> +++ b/gnu/services/cgit.scm >> @@ -642,13 +642,19 @@ for cgit to allow access to that repository.") >> (not (memq (configuration-field-name field) >> '(project-list >> repository-directory >> - repositories)))) >> + repositories >> + extra-options)))) > > ---^ > Very small nitpick: could you put extra-options between project-list and > repository-directory there? So that the order is the same with what > comes below. Sure, this should be fixed now. >> #~(string-append >> #$(let ((rest (filter rest? cgit-configuration-fields))) >> (serialize-configuration config rest)) >> #$(serialize-project-list >> 'project-list >> (cgit-configuration-project-list config)) >> + #$(string-join >> + (append >> + (cgit-configuration-extra-options config) >> + '("")) >> + "\n") > > Could you put the serialization code in a dedicated function? > (e.g. SERIALIZE-EXTRA-OPTION) So that SERIALIZE-CGIT-CONFIGURATION is > only responsible for the field ordering. Done. > Also, I don't understand why you append '(""). If it's just to make > cgitrc look prettier, I'm not sure it's a good idea. But maybe I missed > something? The '("") was to add an extra newline effectively. I've replaced this by using the 'suffix option of string-join in the updated patch. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlr+sWxfFIAAAAAALgAo aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE 9XeMfg//Q3G0JDRriOWoBX51ubpLmqidrDeZ+KmIhpw172nV9QVa7pb22SO9skPL eSmeq14LhY0Slivf/w0k7/0jkfRJBQZyR8aJQ/EFySFKpG6XB6DwVZK0p4ksujOG U6RQ0zoHCYed4Ygxmf+kRKgtUwFWGRuFraCkwjIenaNv4kcXDhSYkbQCl6rGuDKW /JldwjaBMV0O6JOrwgTmtNTMg18ZY2vlo8AfjEJeUbPEw8k7McKBbT39liMydm8o 3FqrBpl29pC1rimdHOrxx4kmCme0UcqsPfT5ZqHJBvQ1/bWYa+awjoE9BOsHKW4u ZXVbtvoalS036SsAJPtMR6NluVs85ukWR2bGTV4vYSc+r5RbqLnY9DqNDlDAz0/K klYq0v3nT0LHe5ZJeqes7niQzLgsjZPM1PbTxQ22Aj1qb+uCgzccVAe4QJ27Ii8J eWdp+ijahUU+uSxid1vbJzTJCuI0f1yacvIj53WV1dhjmWnXtau2ayx9Nv9ZokpD DXXNwkSkTXHENn1sJ92Kk+2dA9DKxT0BocZoErqhoLNHqKqAKLlbFUdsn8T17L2P 7XmaXI6IVqs60BpaB73YQVaW7nUgHxlfvMvL+R24R3lJ60qj9SQySi35vaUH1mLd s54RPotQlBiohjWZ8mqEyE0VUE2RuaezIMDJe1oxt0DKT/siyeU= =n6jj -----END PGP SIGNATURE----- --=-=-=--