From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48322) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1esmXO-0004q1-RP for guix-patches@gnu.org; Mon, 05 Mar 2018 04:36:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1esmXJ-0003zB-V6 for guix-patches@gnu.org; Mon, 05 Mar 2018 04:36:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:37230) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1esmXJ-0003ys-Q2 for guix-patches@gnu.org; Mon, 05 Mar 2018 04:36:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1esmXJ-0008WA-KX for guix-patches@gnu.org; Mon, 05 Mar 2018 04:36:01 -0500 Subject: [bug#30701] [PATCH 1/4] services: Rework the PostgreSQL config file to use a record type. Resent-Message-ID: References: <87po4jpsgc.fsf@cbaines.net> <20180304191633.20262-1-mail@cbaines.net> <87lgf7z7jp.fsf@lassieur.org> <87lgf7ot6u.fsf@cbaines.net> From: =?UTF-8?Q?Cl=C3=A9ment?= Lassieur In-reply-to: <87lgf7ot6u.fsf@cbaines.net> Date: Mon, 05 Mar 2018 10:35:49 +0100 Message-ID: <87efkyzwy2.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: Christopher Baines Cc: 30701@debbugs.gnu.org Christopher Baines writes: > Clément Lassieur writes: > >> Hi Christopher, >> >> Christopher Baines writes: >> >>> For the default config file representation. This makes it possible to more >>> easily change the configuration file, and have dynamic content. In particular, >>> I'm looking at adding a pid file location to the config file. >>> >>> * gnu/services/databases.scm (): New record type. >>> (%default-postgres-config): Remove this, it's been replaced by the >>> configuration file. >>> (): Alter the default for the config file field. >>> (postgresql-service): Alter the default value for the config-file parameter. >>> --- >>> gnu/services/databases.scm | 86 +++++++++++++++++++++++++++++++++++----------- >>> 1 file changed, 66 insertions(+), 20 deletions(-) >> >> Thank you for this work! > > No problem, I've finally got around to going through some patches I've > had sitting around for a while. > >>> +(define-gexp-compiler (postgresql-config-file-compiler >>> + (file ) system target) >>> + (match file >>> + (($ log-destination hba-file >>> + ident-file extra-config) >>> + (define (quote string) >>> + (if string >>> + (list "'" string "'") >>> + (list))) >> >> I don't think it's a good thing to hide one of the most important lisp >> functions :-). > > I don't quite follow. I was trying to use '() rather than (list) if that > is what you mean, but I kept getting odd errors from Guile, so I gave > up, and ended up going with this. You couldn't use '() because '() is the same thing as (quote ()) and you redefined 'quote'.