guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] gnu: Use a directory owned by ntpd user for drift file.


From: Ludovic Courtès
Subject: Re: [PATCH] gnu: Use a directory owned by ntpd user for drift file.
Date: Fri, 09 Sep 2016 11:30:41 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Hi,

Vincent Legoll <address@hidden> skribis:

>> +(define (ntp-service-activation config)
>> +  "Return the activation gexp for config"
>> +  #~(begin
>> +      (use-modules (guix build utils))
>> +
>> +      (define %user
>> +        (getpw "ntpd"))
>> +
>> +      (let ((directory "/var/run/ntpd"))
>> +          (mkdir-p directory)
>> +          (chown directory (passwd:uid %user) (passwd:gid %user)))))
>> +
>
> Excuse my scheme-newbie questions, but
>
> - why did you use %user (I thought %s were for kind of global vars) ?

In the context of this gexp it’s a global variable.

> - why did you use define and not put it in the let just below ? Idon't see
> it being used elsewhere...

Both styles are OK, though putting it in the ‘let’ would have made it
more concise, indeed.  :-)

Ludo’.



reply via email to

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