guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/2] dmd: Make config file if necessary when not run as root.


From: Ludovic Courtès
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
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Alex Sassmannshausen <address@hidden> 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 <address@hidden>
> +;;
> +;; 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 <http://www.gnu.org/licenses/>.

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 ‘make-service’ and ‘register-services’ (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’.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]