From: Mathieu Lirzin <mthl@gnu.org>
To: guix-devel@gnu.org
Subject: Re: [PATCH 3/3] support: Rename user-dmddir to %user-shepherd-dir.
Date: Sun, 17 Jan 2016 15:05:55 +0100 [thread overview]
Message-ID: <87a8o42tdo.fsf@gnu.org> (raw)
In-Reply-To: <1452982661-17268-4-git-send-email-mthl@gnu.org> (Mathieu Lirzin's message of "Sat, 16 Jan 2016 23:17:41 +0100")
Mathieu Lirzin <mthl@gnu.org> writes:
> * modules/shepherd/support.scm (user-dmddir): Rename to ...
> (%user-shepherd-dir): ... this. Honor XDG variables and use
> '~/.config/shepherd' as default value. All consumers changed.
> (mkdir-p): New procedure. Export it.
> (default-config-file): Use it.
> (verify-dir): Likewise.
> ---
> modules/shepherd/support.scm | 45 ++++++++++++++++++++++++++++++++++++--------
> 1 file changed, 37 insertions(+), 8 deletions(-)
[...]
> +(define* (mkdir-p dir #:optional (mode (umask))) ;copied from Guix
^^^
not in Guix yet.
> + "Create directory DIR and all its ancestors."
> + (define absolute?
> + (string-prefix? "/" dir))
> +
> + (define not-slash
> + (char-set-complement (char-set #\/)))
> +
> + (let loop ((components (string-tokenize dir not-slash))
> + (root (if absolute?
> + ""
> + ".")))
> + (match components
> + ((head tail ...)
> + (let ((path (string-append root "/" head)))
> + (catch 'system-error
> + (lambda ()
> + (mkdir path mode)
> + (loop tail path))
> + (lambda args
> + (if (= EEXIST (system-error-errno args))
> + (loop tail path)
> + (apply throw args))))))
> + (() #t))))
I have tried to apply this change (add an optional parameter) on top of
Guix, but it produces a ton of failures for ‘make check’ :).
So my conclusion is that it is not possible to set a default value. So I
think it required to do something like:
(define* (mkdir-p dir #:optional mode)
...
(if mode
(mkdir path mode)
(mkdir path))
...)
Am I correct?
--
Mathieu Lirzin
next prev parent reply other threads:[~2016-01-17 14:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-16 22:17 [PATCH 0/3] [Shepherd][PATCH 0/3] Change configuration file Mathieu Lirzin
2016-01-16 22:17 ` [PATCH 1/3] maint: Add .dir-locals.el Mathieu Lirzin
2016-01-17 14:07 ` Ludovic Courtès
2016-01-16 22:17 ` [PATCH 2/3] support: Add a keyword argument '#:secure?' to verify-dir Mathieu Lirzin
2016-01-17 14:08 ` Ludovic Courtès
2016-01-16 22:17 ` [PATCH 3/3] support: Rename user-dmddir to %user-shepherd-dir Mathieu Lirzin
2016-01-17 14:05 ` Mathieu Lirzin [this message]
2016-01-17 20:43 ` Ludovic Courtès
2016-01-17 21:51 ` Mathieu Lirzin
2016-01-18 21:08 ` Ludovic Courtès
2016-01-17 14:19 ` Ludovic Courtès
2016-01-17 20:49 ` Mathieu Lirzin
2016-01-17 21:06 ` Mathieu Lirzin
2016-01-18 20:59 ` 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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a8o42tdo.fsf@gnu.org \
--to=mthl@gnu.org \
--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 public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).