[augeas-devel] [PATCH 2 of 4] Allow multiple comma-separated fs types in fstab
David Lutterkort
dlutter at redhat.com
Sat May 31 00:41:06 UTC 2008
2 files changed, 16 insertions(+), 3 deletions(-)
lenses/fstab.aug | 7 ++++---
lenses/tests/test_fstab.aug | 12 ++++++++++++
# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1212190532 25200
# Node ID 3832130b0bbe5067bf1d4f3d2d20ba736ca66f8e
# Parent fed370da34a7911d7245023f2ddb30ddee3c01cc
Allow multiple comma-separated fs types in fstab
On Debian Etch, the CDROM has fs type 'udf,iso9660'
diff -r fed370da34a7 -r 3832130b0bbe lenses/fstab.aug
--- a/lenses/fstab.aug Fri May 30 16:26:29 2008 -0700
+++ b/lenses/fstab.aug Fri May 30 16:35:32 2008 -0700
@@ -10,12 +10,13 @@
let comment = [ del /#.*\n/ "# " ]
let word = /[^,# \n\t]+/
+ let comma_sep_list (l:string) =
+ [ label l . store word ] . ([comma . label l . store word])*
let record = [ seq "mntent" .
[ label "spec" . store word ] . sep_tab .
[ label "file" . store word ] . sep_tab .
- [ label "vfstype" . store word ] . sep_tab .
- [ label "opt" . store word ] .
- ([comma . label "opt" . store word])* .
+ comma_sep_list "vfstype" . sep_tab .
+ comma_sep_list "opt" .
(sep_tab . [ label "dump" . store /[0-9]+/ ] .
( sep_spc . [ label "passno" . store /[0-9]+/ ])? )?
. eol ]
diff -r fed370da34a7 -r 3832130b0bbe lenses/tests/test_fstab.aug
--- a/lenses/tests/test_fstab.aug Fri May 30 16:26:29 2008 -0700
+++ b/lenses/tests/test_fstab.aug Fri May 30 16:35:32 2008 -0700
@@ -58,6 +58,18 @@
test Fstab.lns get multi_opts = multi_opts_tree
+ test Fstab.lns get "/dev/hdc /media/cdrom0 udf,iso9660 user,noauto\t0\t0\n" =
+ { "1"
+ { "spec" = "/dev/hdc" }
+ { "file" = "/media/cdrom0" }
+ { "vfstype" = "udf" }
+ { "vfstype" = "iso9660" }
+ { "opt" = "user" }
+ { "opt" = "noauto" }
+ { "dump" = "0" }
+ { "passno" = "0" } }
+
+
(* Local Variables: *)
(* mode: caml *)
(* End: *)
More information about the augeas-devel
mailing list