Blame SOURCES/0002-Revert-Use-Quote-module-in-dovecot.patch

84dac3
From 2765da41b09cdfcf2f28653a484462ee7109116a Mon Sep 17 00:00:00 2001
84dac3
From: Dominic Cleal <dcleal@redhat.com>
84dac3
Date: Fri, 12 Jun 2015 09:32:56 +0100
84dac3
Subject: [PATCH] Revert "Use Quote module in dovecot"
84dac3
84dac3
This reverts commit 735caf587959019d214a51a7c0cce57da9bb88f6 for
84dac3
compatibility with Augeas 1.1.0.
84dac3
84dac3
Values will have quotes in them as they did in 1.1.0, not stripped out.
84dac3
84dac3
Conflicts:
84dac3
	lenses/dovecot.aug
84dac3
---
84dac3
 lenses/dovecot.aug            | 28 +++++-----------------------
84dac3
 lenses/tests/test_dovecot.aug |  2 +-
84dac3
 2 files changed, 6 insertions(+), 24 deletions(-)
84dac3
84dac3
diff --git a/lenses/dovecot.aug b/lenses/dovecot.aug
84dac3
index f7afc8f9..c6376e4b 100644
84dac3
--- a/lenses/dovecot.aug
84dac3
+++ b/lenses/dovecot.aug
84dac3
@@ -56,6 +56,9 @@ let value = any . (Rx.space . any)*
84dac3
 (* View: command_start *)
84dac3
 let command_start = Util.del_str "!"
84dac3
 
84dac3
+(* View: block_args 
84dac3
+Map block arguments after block name and before "{" *)
84dac3
+let block_args = Sep.space . store /([A-Za-z0-9\/\\_-]+|\"[A-Za-z0-9 ]*\")/
84dac3
 
84dac3
 (******************************************************************
84dac3
  * Group:                        ENTRIES
84dac3
@@ -79,28 +82,7 @@ let entry = [ indent . key keys. eq . (Sep.opt_space . store value)? . eol ]
84dac3
 Map commands started with "!". *)
84dac3
 let command = [ command_start . key commands . Sep.space . store Rx.fspath . eol ]
84dac3
 
84dac3
-(*
84dac3
-View: dquote_spaces
84dac3
-  Make double quotes mandatory if value contains spaces,
84dac3
-  and optional if value doesn't contain spaces.
84dac3
-
84dac3
-Based off Quote.dquote_spaces
84dac3
-
84dac3
-Parameters:
84dac3
-  lns1:lens - the lens before
84dac3
-  lns2:lens - the lens after
84dac3
-*)
84dac3
-let dquote_spaces (lns1:lens) (lns2:lens) =
84dac3
-     (* bare has no spaces, and is optionally quoted *)
84dac3
-     let bare = Quote.do_dquote_opt (store /[^" \t\n]+/)
84dac3
-     (* quoted has at least one space, and must be quoted *)
84dac3
-  in let quoted = Quote.do_dquote (store /[^"\n]*[ \t]+[^"\n]*/)
84dac3
-  in [ lns1 . bare . lns2 ] | [ lns1 . quoted . lns2 ]
84dac3
-
84dac3
-let mailbox = indent
84dac3
-            . dquote_spaces
84dac3
-               (key /mailbox/ . Sep.space)
84dac3
-               (Build.block_newlines_spc entry comment . eol)
84dac3
+let mailbox = [ indent . key /mailbox/ . block_args? . Build.block_newlines_spc (entry) comment . eol ]
84dac3
 
84dac3
 let block_ldelim_newlines_re = /[ \t]+\{([ \t\n]*\n)?/
84dac3
 
84dac3
@@ -114,7 +96,7 @@ let block_newlines (entry:lens) (comment:lens) =
84dac3
 Map block enclosed in brackets recursively.
84dac3
 Block may be indented and have optional argument.
84dac3
 Block body may have entries, comments, empty lines, and nested blocks recursively. *)
84dac3
-let rec block = [ indent . key block_names . (Sep.space . Quote.do_dquote_opt (store /[\/A-Za-z0-9_-]+/))? . block_newlines (entry|block|mailbox) comment . eol ]
84dac3
+let rec block = [ indent . key block_names . block_args? . block_newlines (entry|block|mailbox) comment . eol ]
84dac3
 
84dac3
 
84dac3
 (******************************************************************
84dac3
diff --git a/lenses/tests/test_dovecot.aug b/lenses/tests/test_dovecot.aug
84dac3
index 33ea16f1..8e8c083b 100644
84dac3
--- a/lenses/tests/test_dovecot.aug
84dac3
+++ b/lenses/tests/test_dovecot.aug
84dac3
@@ -536,7 +536,7 @@ test Dovecot.lns get mail_conf =
84dac3
     { "hidden" = "no" }
84dac3
     { "list" = "yes" }
84dac3
     { "subscriptions" = "yes" }
84dac3
-    { "mailbox" = "Sent Messages" 
84dac3
+    { "mailbox" = "\"Sent Messages\"" 
84dac3
       { "special_use" = "\Sent" }
84dac3
     }
84dac3
   }
84dac3
-- 
7b8067
2.14.3
84dac3