From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 2/2] dmd: Make config file if necessary when not run as root. Date: Tue, 04 Feb 2014 21:41:16 +0100 Message-ID: <87txcebogj.fsf@gnu.org> References: <1391449065-19063-1-git-send-email-alex.sassmannshausen@gmail.com> <1391449065-19063-3-git-send-email-alex.sassmannshausen@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAmt0-0002hn-5z for guix-devel@gnu.org; Tue, 04 Feb 2014 15:46:31 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WAmsu-0002UF-Al for guix-devel@gnu.org; Tue, 04 Feb 2014 15:46:26 -0500 Received: from hera.aquilenet.fr ([141.255.128.1]:56869) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WAmst-0002TE-TQ for guix-devel@gnu.org; Tue, 04 Feb 2014 15:46:20 -0500 In-Reply-To: <1391449065-19063-3-git-send-email-alex.sassmannshausen@gmail.com> (Alex Sassmannshausen's message of "Mon, 3 Feb 2014 18:37:45 +0100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Alex Sassmannshausen Cc: guix-devel@gnu.org Alex Sassmannshausen skribis: > * modules/dmd/support.scm (make-bare-init-file): new procedure to > generate basic init file. > (default-logfile): Check for init file, create it if necessary. A good idea to help people get started! A couple of comments: > +(define (make-bare-init-file target) > + "Return #t if a bare init file was created at TARGET; #f otherwise. > + > +TARGET should be a string representing a filepath + name." > + (with-output-to-file target > + (lambda () > + (format #t > +";; init.scm -- default dmd configuration file. > +;; Copyright (C) 2014 A. Sassmannshausen > +;; > +;; This file is part of GNU dmd. > +;; > +;; GNU dmd is free software; you can redistribute it and/or modify it > +;; under the terms of the GNU General Public License as published by > +;; the Free Software Foundation; either version 3 of the License, or (at > +;; your option) any later version. > +;; > +;; GNU dmd is distributed in the hope that it will be useful, but > +;; WITHOUT ANY WARRANTY; without even the implied warranty of > +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +;; GNU General Public License for more details. > +;; > +;; You should have received a copy of the GNU General Public License > +;; along with GNU dmd. If not, see . I think the skeleton file should not include a copyright notice. > +;; Services known to dmd: > +;; Add new services to dmd here by providing them through the > +;; MAKE-SERVICE procedure to REGISTER SERVICES. IMO this should be =E2=80=98make-service=E2=80=99 and =E2=80=98register-ser= vices=E2=80=99 (lower-case, quoted.) > + (register-services) ^ Extra space here. > +;; Send dmd into the background > + (action 'dmd 'daemonize) Ditto. > +;; Services to start when dmd starts: > +;; Add the name of each service known to dmd that should be started to > +;;the list passed to FOR-EACH. > + (for-each start '()) Ditto. > (let ((config-file (string-append user-dmddir "/init.scm"))) > (cond ((not (file-exists? user-dmddir)) > (mkdir user-dmddir) > + (make-bare-init-file config-file) > config-file) > + ((not (file-exists? config-file)) > + (make-bare-init-file config-file)) > (else config-file)))))) So I guess this should be changed to: (catch 'system-error (lambda () (mkdir user-dmddir) (make-bare-init-file config-file)) (const #f)) Thanks! Ludo=E2=80=99.