From: ludo@gnu.org (Ludovic Courtès)
To: Alex Sassmannshausen <alex.sassmannshausen@gmail.com>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 2/2] dmd: Make config file if necessary when not run as root.
Date: Wed, 05 Feb 2014 21:17:56 +0100 [thread overview]
Message-ID: <87ha8d5n63.fsf@gnu.org> (raw)
In-Reply-To: <87ob2l4dqi.fsf@gmail.com> (Alex Sassmannshausen's message of "Wed, 05 Feb 2014 19:27:01 +0100")
Alex Sassmannshausen <alex.sassmannshausen@gmail.com> skribis:
> Ludovic Courtès writes:
[...]
>>> + (register-services)
>> ^
>>> +;; Send dmd into the background
>>> + (action 'dmd 'daemonize)
>> ^
>>> + (for-each start '())
>> ^
>>
>> Extra space here.
>
> The extra spaces were there to stop emacs (maybe Scheme mode?) from
> going nutty because of the open parens within a string at column 0.
Oh, right, I forgot that.
[...]
>>> (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))
>
> I've changed this to :
>
> (catch-system-error (mkdir user-dmddir))
> (if (not (file-exists? config-file))
> (make-bare-init-file config-file))
> config-file)))
[...]
> I also think the race condition should not be a problem for the config
> file: if the config file is added after the check, then we simply
> override it. If the config file is removed after the check then guix
> crashes when it tries to load it, as it always would do before this
> patch.
Right. Hopefully it’s not a problem with the test suite because tests
use ‘-c’ anyway.
> Hope this works now. You should find the patch inline.
Yep. Pushed, thanks!
Ludo’.
next prev parent reply other threads:[~2014-02-05 20:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-03 17:37 dmd: make user-mode easier to use Alex Sassmannshausen
2014-02-03 17:37 ` =?y?q?=5BPATCH=201/2=5D=20dmd=3A=20Use=20=7E/=2Edmd=2Ed/=20by=20default=20when=20not=20run=20as=20root=2E?= Alex Sassmannshausen
2014-02-04 20:34 ` [PATCH 1/2] dmd: Use ~/.dmd.d/ by default when not run as root Ludovic Courtès
2014-02-03 17:37 ` [PATCH 2/2] dmd: Make config file if necessary " Alex Sassmannshausen
2014-02-04 20:41 ` Ludovic Courtès
2014-02-05 18:27 ` Alex Sassmannshausen
2014-02-05 20:17 ` Ludovic Courtès [this message]
2014-02-04 20:34 ` dmd: make user-mode easier to use Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ha8d5n63.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=alex.sassmannshausen@gmail.com \
--cc=guix-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.