From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 3/3] support: Rename user-dmddir to %user-shepherd-dir. Date: Sun, 17 Jan 2016 21:43:16 +0100 Message-ID: <877fj8544b.fsf@gnu.org> References: <1452982661-17268-1-git-send-email-mthl@gnu.org> <1452982661-17268-4-git-send-email-mthl@gnu.org> <87a8o42tdo.fsf@gnu.org> 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]:54502) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKuAU-0005Ip-Mh for guix-devel@gnu.org; Sun, 17 Jan 2016 15:43:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKuAR-0000Rs-9Z for guix-devel@gnu.org; Sun, 17 Jan 2016 15:43:22 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:37474) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKuAR-0000Ro-6Q for guix-devel@gnu.org; Sun, 17 Jan 2016 15:43:19 -0500 In-Reply-To: <87a8o42tdo.fsf@gnu.org> (Mathieu Lirzin's message of "Sun, 17 Jan 2016 15:05:55 +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: Mathieu Lirzin Cc: guix-devel@gnu.org Mathieu Lirzin skribis: > Mathieu Lirzin 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. [...] > I have tried to apply this change (add an optional parameter) on top of > Guix, but it produces a ton of failures for =E2=80=98make check=E2=80=99 = :). What=E2=80=99s the failure exactly? > 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? That would work=E2=80=A6 but why do we need =E2=80=98mode=E2=80=99 in the = first place? It seems that the semantics are fuzzy, because the result may differ depending on which components of DIR already exist when =E2=80=98mkdir-p=E2= =80=99 is called, and the user can just set the process=E2=80=99 umask before calling= it. WDYT? Ludo=E2=80=99.