[augeas-devel] [PATCH] Shellvars: handle space at the end of a line
David Lutterkort
lutter at redhat.com
Fri Sep 5 15:58:58 UTC 2008
2 files changed, 3 insertions(+), 1 deletion(-)
lenses/shellvars.aug | 2 +-
lenses/tests/test_shellvars.aug | 2 ++
# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1220630335 25200
# Node ID 2079ee4ab3bab3d3e53ad1b62d0e85c785e1dc3e
# Parent 76b4a5665cd6a32cc46131091c2860176b864033
Shellvars: handle space at the end of a line
diff -r 76b4a5665cd6 -r 2079ee4ab3ba lenses/shellvars.aug
--- a/lenses/shellvars.aug Thu Sep 04 16:11:35 2008 -0700
+++ b/lenses/shellvars.aug Fri Sep 05 08:58:55 2008 -0700
@@ -2,7 +2,7 @@
(* in /etc/sysconfig *)
module Shellvars =
- let eol = Util.del_str "\n"
+ let eol = del /[ \t]*\n/ "\n"
let key_re = /[A-Za-z0-9_]+(\[[0-9]+\])?/
let eq = Util.del_str "="
diff -r 76b4a5665cd6 -r 2079ee4ab3ba lenses/tests/test_shellvars.aug
--- a/lenses/tests/test_shellvars.aug Thu Sep 04 16:11:35 2008 -0700
+++ b/lenses/tests/test_shellvars.aug Fri Sep 05 08:58:55 2008 -0700
@@ -50,6 +50,8 @@
test Shellvars.lns get "smartd_opts=\"-q never\"\n" =
{ "smartd_opts" = "\"-q never\"" }
+ test Shellvars.lns get "var=val \n" = { "var" = "val" }
+
test Shellvars.lns get ". /etc/java/java.conf\n" =
{ ".source" = "/etc/java/java.conf" }
More information about the augeas-devel
mailing list