From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f60N4-0007S0-Cm for guix-patches@gnu.org; Tue, 10 Apr 2018 17:00:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f60N0-00087m-Gt for guix-patches@gnu.org; Tue, 10 Apr 2018 17:00:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:37572) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f60N0-00087c-Dg for guix-patches@gnu.org; Tue, 10 Apr 2018 17:00:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f60N0-0002ne-2c for guix-patches@gnu.org; Tue, 10 Apr 2018 17:00:02 -0400 Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. Resent-Message-ID: From: ludo@gnu.org (Ludovic =?UTF-8?Q?Court=C3=A8s?=) References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-3-clement@lassieur.org> Date: Tue, 10 Apr 2018 22:59:23 +0200 In-Reply-To: <20180407170709.22160-3-clement@lassieur.org> ("=?UTF-8?Q?Cl=C3=A9ment?= Lassieur"'s message of "Sat, 7 Apr 2018 19:07:07 +0200") Message-ID: <87r2nm6ams.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: > * doc/guix.texi (Version Control Services): Update accordingly. > * gnu/services/cgit.scm (serialize-field, serialize-string, serialize-boo= lean, > serialize-integer, serialize-repository-cgit-configuration-list, > serialize-nginx-server-configuration-list, serialize-repo-field, > serialize-repo-boolean, serialize-repo-integer, serialize-module-link-pat= h, > serialize-repository-directory, serialize-mimetype-alist): Return strings= or > string-valued gexps and stop printing. > (repository-cgit-configuration)[source-filter, about-filter, commit-filte= r, > logo, owner-filter], (cgit-configuration)[auth-filter, commit-filter, css, > email-filter, favicon, include, logo, owner-filter, mimetype-file, readme, > source-filter]: Replace STRING with FILE-OBJECT. > (file-object?, serialize-file-object, repo-file-object?, > serialize-repo-file-object): New procedures. > (cgit-activation): Use SERIALIZE-CONFIGURATION's return value with > MIXED-TEXT-FILE instead of using its output with PLAIN-FILE. Nice! > (config-str > (if opaque-config? > (opaque-cgit-configuration-cgitrc config) > - (with-output-to-string > - (lambda () > - (serialize-configuration config > - cgit-configuration-fields))))= )) > + (serialize-configuration config cgit-configuration-fields)= ))) > #~(begin > (use-modules (guix build utils)) > (mkdir-p #$(if opaque-config? > (opaque-cgit-configuration-cache-root config) > (cgit-configuration-cache-root config))) > - (copy-file #$(plain-file "cgitrc" config-str) "/etc/cgitrc")))) > + (copy-file #$(mixed-text-file "cgitrc" config-str) > + "/etc/cgitrc")))) For clarity, since =E2=80=98config-str=E2=80=99 is no longer a string (righ= t?), I=E2=80=99d rename it to just =E2=80=98config=E2=80=99 or something. Also, could it be that you=E2=80=99re missing =E2=80=98apply=E2=80=99 above= , as in: (apply mixed-text-file "cgitrc" config-str) ? Otherwise LGTM, thanks! Ludo=E2=80=99.