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

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