From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f6BEc-0006WR-A1 for guix-patches@gnu.org; Wed, 11 Apr 2018 04:36:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f6BEY-0002cn-Bp for guix-patches@gnu.org; Wed, 11 Apr 2018 04:36:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:37793) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f6BEY-0002ci-7y for guix-patches@gnu.org; Wed, 11 Apr 2018 04:36:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1f6BEY-0001zv-13 for guix-patches@gnu.org; Wed, 11 Apr 2018 04:36:02 -0400 Subject: [bug#31089] [PATCH 3/5] services: cgit: Add support for file-like objects. Resent-Message-ID: References: <20180407170709.22160-1-clement@lassieur.org> <20180407170709.22160-3-clement@lassieur.org> <87r2nm6ams.fsf@gnu.org> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87r2nm6ams.fsf@gnu.org> Date: Wed, 11 Apr 2018 10:35:19 +0200 Message-ID: <87woxei1iw.fsf@lassieur.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 31089@debbugs.gnu.org Ludovic Courtès writes: >> (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 ‘config-str’ is no longer a string (right?), I’d > rename it to just ‘config’ or something. > > Also, could it be that you’re missing ‘apply’ above, as in: > > (apply mixed-text-file "cgitrc" config-str) > > ? Yes, config-str is still a string (or a string-valued gexp). I use mixed-text-file because it can take gexps as arguments, whereas plain-file can't. > Otherwise LGTM, thanks! Thank you for the review! Clément