From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34375) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gb5sI-0001zn-8W for guix-patches@gnu.org; Sun, 23 Dec 2018 10:41:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gb5sE-0000Qc-4R for guix-patches@gnu.org; Sun, 23 Dec 2018 10:41:06 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:57885) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gb5sE-0000QR-0r for guix-patches@gnu.org; Sun, 23 Dec 2018 10:41:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gb5sD-0003mh-T6 for guix-patches@gnu.org; Sun, 23 Dec 2018 10:41:01 -0500 Subject: [bug#33836] [PATCH 1/2] services: configuration: Add location. Resent-Message-ID: From: Oleg Pykhalov Date: Sun, 23 Dec 2018 18:40:20 +0300 Message-Id: <20181223154021.14287-1-go.wigust@gmail.com> In-Reply-To: <874lb45nov.fsf@gmail.com> References: <874lb45nov.fsf@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33836@debbugs.gnu.org * gnu/services/configuration.scm (define-configuration): Add location. * gnu/services/mail.scm (namespace-configuration)[location]: Rename to 'mailbox-location'. (uglify-field-name): Handle this. * doc/guix.texi (Mail Services): Document this. --- doc/guix.texi | 2 +- gnu/services/configuration.scm | 5 +++++ gnu/services/mail.scm | 11 +++++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/doc/guix.texi b/doc/guix.texi index e254b3859..a6db2461d 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -14665,7 +14665,7 @@ different for all namespaces. For example @samp{Public/}. Defaults to @samp{""}. @end deftypevr -@deftypevr {@code{namespace-configuration} parameter} string location +@deftypevr {@code{namespace-configuration} parameter} string mailbox-location Physical location of the mailbox. This is in the same format as mail_location, which is also the default for it. Defaults to @samp{""}. diff --git a/gnu/services/configuration.scm b/gnu/services/configuration.scm index 707944cbe..9775f91ff 100644 --- a/gnu/services/configuration.scm +++ b/gnu/services/configuration.scm @@ -22,6 +22,7 @@ #:use-module (guix packages) #:use-module (guix records) #:use-module (guix gexp) + #:use-module ((guix utils) #:select (source-properties->location)) #:autoload (texinfo) (texi-fragment->stexi) #:autoload (texinfo serialize) (stexi->texi) #:use-module (ice-9 match) @@ -129,6 +130,10 @@ #,(id #'stem #'% #'stem) #,(id #'stem #'make- #'stem) #,(id #'stem #'stem #'?) + (location configuration-location + (default (and=> (current-source-location) + source-properties->location)) + (innate)) (field field-getter (default def)) ...) (define #,(id #'stem #'stem #'-fields) diff --git a/gnu/services/mail.scm b/gnu/services/mail.scm index fcaedd038..a8121e5d1 100644 --- a/gnu/services/mail.scm +++ b/gnu/services/mail.scm @@ -75,9 +75,12 @@ (define (uglify-field-name field-name) (let ((str (symbol->string field-name))) - (string-join (string-split (if (string-suffix? "?" str) - (substring str 0 (1- (string-length str))) - str) + (string-join (string-split (cond + ((string-suffix? "?" str) + (substring str 0 (1- (string-length str)))) + ((string=? str "mailbox-location") + "location") + (else str)) #\-) "_"))) @@ -413,7 +416,7 @@ format.") "Prefix required to access this namespace. This needs to be different for all namespaces. For example @samp{Public/}.") - (location + (mailbox-location (string "") "Physical location of the mailbox. This is in same format as mail_location, which is also the default for it.") -- 2.20.1