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

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