[augeas-devel] augeas: master - Cron: variable names can contain '_' etc.

David Lutterkort lutter at fedoraproject.org
Thu Nov 26 01:15:33 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=d05e16365e5883ec766be96537a4376a245a4d4f
Commit:        d05e16365e5883ec766be96537a4376a245a4d4f
Parent:        9209d5f6ecb7a78ad9643cb078196e3e0d21fb22
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Wed Nov 25 16:33:50 2009 -0800
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Wed Nov 25 16:33:50 2009 -0800

Cron: variable names can contain '_' etc.

Use Shellvars.key_re for consistency.

Fixes ticket #94
---
 lenses/cron.aug            |    5 +++--
 lenses/tests/test_cron.aug |    2 ++
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lenses/cron.aug b/lenses/cron.aug
index 56595f4..ff0aaaf 100644
--- a/lenses/cron.aug
+++ b/lenses/cron.aug
@@ -72,8 +72,9 @@ let sep_eq  = Util.del_str "="
  *   A shell variable in crontab
  *************************************************************************)
 
-let shellvar = [ key /[A-Z][A-Za-z0-9]*/ . sep_eq
-                 . Shellvars.simple_value . eol ]
+let shellvar =
+  let key_re = Shellvars.key_re - "entry" in
+  [ key key_re . sep_eq . Shellvars.simple_value . eol ]
 
 
 (* View: minute *)
diff --git a/lenses/tests/test_cron.aug b/lenses/tests/test_cron.aug
index 56d4070..cfd8e2a 100644
--- a/lenses/tests/test_cron.aug
+++ b/lenses/tests/test_cron.aug
@@ -4,6 +4,7 @@ module Test_cron =
 
 SHELL=/bin/sh
 PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+CRON_TZ=America/Los_Angeles
 
 	30 7      * * *   root	test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null
   00 */3    15-25/2 May 1-5   user   somecommand
@@ -15,6 +16,7 @@ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
       {}
       { "SHELL" = "/bin/sh" }
       { "PATH"  = "/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin" }
+      { "CRON_TZ" = "America/Los_Angeles" }
       {}
       { "entry" = "test -x /etc/init.d/anacron && /usr/sbin/invoke-rc.d anacron start >/dev/null"
           { "time"




More information about the augeas-devel mailing list