From patchwork Sun Dec 23 15:40:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Pykhalov X-Patchwork-Id: 527 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 77E25169C6; Sun, 23 Dec 2018 15:41:18 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.nongnu.org (lists.nongnu.org [IPv6:2001:4830:134:3::12]) by mira.cbaines.net (Postfix) with ESMTP id 1FC03169C3 for ; Sun, 23 Dec 2018 15:41:18 +0000 (GMT) Received: from localhost ([::1]:45418 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gb5sT-0001zu-OS for patchwork@mira.cbaines.net; Sun, 23 Dec 2018 10:41:17 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#33836] [PATCH 1/2] services: configuration: Add location. Resent-From: Oleg Pykhalov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 23 Dec 2018 15:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33836 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33836@debbugs.gnu.org Received: via spool by 33836-submit@debbugs.gnu.org id=B33836.154557965114524 (code B ref 33836); Sun, 23 Dec 2018 15:41:01 +0000 Received: (at 33836) by debbugs.gnu.org; 23 Dec 2018 15:40:51 +0000 Received: from localhost ([127.0.0.1]:33910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gb5s3-0003mC-5o for submit@debbugs.gnu.org; Sun, 23 Dec 2018 10:40:51 -0500 Received: from mail-pf1-f180.google.com ([209.85.210.180]:46353) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gb5s2-0003m0-An for 33836@debbugs.gnu.org; Sun, 23 Dec 2018 10:40:50 -0500 Received: by mail-pf1-f180.google.com with SMTP id c73so4823638pfe.13 for <33836@debbugs.gnu.org>; Sun, 23 Dec 2018 07:40:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DFv7WcYOhDBxExpkXJdbL1IsZDfYo8o7zJQ+YsPoMEc=; b=oCuqF512ac9QHfBTlivfqn1bv3jpm0OxhkLHkTNs5yjyan6EBjMhIicvj/+ATuQ2n8 ON4qX5AawoNLrqeW4/tEW/sBd9vkp/u9Y19d/3KYxRGXLRTI4nGgiX8HpTfXtThm0ZUU zO6QpnLFuYq463lx/5uzs5X4+DAdq30KTWFOKvgwYEiUiuyXtj0/SbPrEKIlSdpA5SCr CQ8BhU+v6l+WohEipRyi1qgWTzyCPBiZ3Mz0Bk5UVjheAnK8fIrjvUhW2+PZI/EG7+MM WUUN4rcGQlDHRDzRZkB2yLA+IETL0vigd4zCSBtCHb86sFbJYepBrjhaPepbjh8EI5nw LZrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=DFv7WcYOhDBxExpkXJdbL1IsZDfYo8o7zJQ+YsPoMEc=; b=DxQQNBucLNOcbRbwq5eRWW8l7aV+fvGxQETt/Dv1Ujbqm3rcuAZVUDGVyy8hXwVTmz NW/iRCRP1JommdtRsYwmgVBUI2HunzctNR+8cNe6TuuPHI62qbHjX67jmI8mUMU1T/By 9XmpYdQbX0480FehTq5YAaTesgvbZrwv+aCeIhUGjPXbCgKeWIm52saYZ+RlZXcn9dtt g8qb2xZrkv33dKRhChLhAJcDe/RlufCSxgZzf6nTamUFfXugKDefUkcJWaFf08ukyGRT Xeeg+2lDwQksLWLLWFlulVPMMQKlgU40KldL0MtCai0T2c5bXIiuxvq1WcoIPrXR6O0g Q2UA== X-Gm-Message-State: AA+aEWb7pTxh3oaNZnUXD5I4N0Ru+wI56HrCXWKfGzTzHY6IpvAsvQ4F PLiYG+Z6WO8NaUWM7HiQ2S+HBk3b X-Google-Smtp-Source: AFSGD/WzioMvlNJTRxD1mPU5uTzhpPlQtmAdWPOszg4oERZM5UmlP34ufbFjCtmKSrYX8mCNNRwoRg== X-Received: by 2002:a62:644:: with SMTP id 65mr10086655pfg.161.1545579644395; Sun, 23 Dec 2018 07:40:44 -0800 (PST) Received: from localhost.localdomain ([178.67.254.124]) by smtp.gmail.com with ESMTPSA id c13sm65002556pfe.93.2018.12.23.07.40.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 23 Dec 2018 07:40:43 -0800 (PST) From: Oleg Pykhalov Date: Sun, 23 Dec 2018 18:40:20 +0300 Message-Id: <20181223154021.14287-1-go.wigust@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <874lb45nov.fsf@gmail.com> References: <874lb45nov.fsf@gmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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.")