guix-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] services: Make dovecot and cups configuration abstractions a


From: Julien Lepiller
Subject: Re: [PATCH] services: Make dovecot and cups configuration abstractions available
Date: Wed, 23 Nov 2016 22:08:26 +0100

On Tue, 22 Nov 2016 23:49:23 +0100
address@hidden (Ludovic Courtès) wrote:

> Hi Julien,
> 
> Julien Lepiller <address@hidden> skribis:
> 
> > since I will probably use it in openvpn-service and maybe in
> > nginx-service, I moved the definitions of the documentation that was
> > duplicated in cups and dovecot to services.scm. Is it the best place
> > for it?  
> 
> Thanks for looking into it!
> 
> I would suggest moving it to a new (gnu services configuration) module
> instead, if that’s fine with you.
> 
> Could you send an updated patch?
Here it is ;)

> 
> BTW, I just checked and there’s at least one subtle difference between
> cups.scm and mail.scm: ‘define-configuration’ in cups.scm defines the
> constructor as a macro that calls ‘validate-configuration’:
> 
>                (define-syntax-rule (stem arg (... ...))
>                  (let ((conf (#,(id #'stem #'% #'stem) arg
> (... ...)))) (validate-configuration conf
>                                            #,(id #'stem #'stem
> #'-fields)) conf))
> 
> The version in mail.scm does not do that, but I think we want to
> preserve it (and your patch does seem to preserve that already).
> 
> Probably the are serializers that can be factorized as well.
I factorized what I saw that was in common between the two files in this
new patch.

> 
> > From 9acc9456f4e61506105bc109298aedb66e31efd0 Mon Sep 17 00:00:00
> > 2001 From: Julien Lepiller <address@hidden>
> > Date: Sun, 20 Nov 2016 17:56:08 +0100
> > Subject: [PATCH] services: Make dovecot and cups configuration
> > abstractions available.
> >
> > * gnu/services.scm: Add configuration-field,
> > configuration-missing-field, configuration-field-error,
> > serialize-confgiuration, define-configuration,
> > validate-configuration, validate-configuration and
> > generate-documetation.
> > * gnu/services/cups.scm: Use it.
> > * gnu/services/mail.scm: Use it.  
> 
> Please take some time to see the ChangeLog convention for this.
Is it better now?

> 
> > + ; (define (str x) (object->string x))
> > + ; (define (generate configuration-name)
> > + ;   (match (assq-ref documentation configuration-name)
> > + ;     ((fields . sub-documentation)
> > + ;      `((para "Available " (code ,(str configuration-name)) "
> > fields are:")
> > + ;        ,@(map
> > + ;           (lambda (f)
> > + ;             (let ((field-name (configuration-field-name f))  
> 
> Why comment things out?  Could it be moved to (gnu services
> configuration) as well?
> 
> Thanks!
> 
> Ludo’.

Attachment: 0001-services-factorize-configuration-abstraction.patch
Description: Text Data


reply via email to

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