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