[augeas-devel] augeas: master - Logrotate: files can be separated by newlines
David Lutterkort
lutter at fedoraproject.org
Wed Feb 24 01:47:15 UTC 2010
Gitweb: http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=fe0453ce79809a3e194fbf4c7cfe1a9b90fc6460
Commit: fe0453ce79809a3e194fbf4c7cfe1a9b90fc6460
Parent: 6216f3cb9c13a313d6aed2ce643c8b202f539627
Author: Raphael Pinson <raphink at gmail.com>
AuthorDate: Tue Feb 23 16:48:16 2010 -0800
Committer: David Lutterkort <lutter at redhat.com>
CommitterDate: Tue Feb 23 16:48:16 2010 -0800
Logrotate: files can be separated by newlines
Fixes bug #104
---
lenses/logrotate.aug | 5 +++--
lenses/tests/test_logrotate.aug | 2 ++
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lenses/logrotate.aug b/lenses/logrotate.aug
index 1ee2b99..0ffc35d 100644
--- a/lenses/logrotate.aug
+++ b/lenses/logrotate.aug
@@ -19,6 +19,7 @@ module Logrotate =
let eol = Util.del_str "\n"
let num = /[0-9]+/
let word = /[^,#= \n\t{}]+/
+ let filename = /\/[^,#= \n\t{}]+/
let size = num . /[kMG]?/
(* define comments and empty lines *)
@@ -101,8 +102,8 @@ module Logrotate =
let rule =
[ label "rule" . Util.indent .
- [ label "file" . store word ] .
- [ del /[ \t]+/ " " . label "file" . store word ]* .
+ [ label "file" . store filename ] .
+ [ del /[ \t\n]+/ " " . label "file" . store filename ]* .
del /[ \t\n]*/ " " . body ]
let lns = ( comment "" | empty | attrs "" | rule )*
diff --git a/lenses/tests/test_logrotate.aug b/lenses/tests/test_logrotate.aug
index 85036ed..83f474a 100644
--- a/lenses/tests/test_logrotate.aug
+++ b/lenses/tests/test_logrotate.aug
@@ -20,6 +20,7 @@ include /etc/logrotate.d
# no packages own wtmp, or btmp -- we'll rotate them here
/var/log/wtmp
+/var/log/wtmp2
{
missingok
monthly
@@ -82,6 +83,7 @@ include /etc/logrotate.d
{ "#comment" = "no packages own wtmp, or btmp -- we'll rotate them here" }
{ "rule"
{ "file" = "/var/log/wtmp" }
+ { "file" = "/var/log/wtmp2" }
{ "missingok" = "missingok" }
{ "schedule" = "monthly" }
{ "create"
More information about the augeas-devel
mailing list