|
Packit Service |
a2ae7a |
(* Parsing /etc/fstab *)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Fstab =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let sep_tab = Sep.tab
|
|
Packit Service |
a2ae7a |
let sep_spc = Sep.space
|
|
Packit Service |
a2ae7a |
let comma = Sep.comma
|
|
Packit Service |
a2ae7a |
let eol = Util.eol
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = Util.comment
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let file = /[^# \t\n]+/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* An option label can't contain comma, comment, equals, or space *)
|
|
Packit Service |
a2ae7a |
let optlabel = /[^,#= \n\t]+/
|
|
Packit Service |
a2ae7a |
let spec = /[^,# \n\t][^ \n\t]*/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comma_sep_list (l:string) =
|
|
Packit Service |
a2ae7a |
let value = [ label "value" . Util.del_str "=" . ( store Rx.neg1 )? ] in
|
|
Packit Service |
a2ae7a |
let lns = [ label l . store optlabel . value? ] in
|
|
Packit Service |
a2ae7a |
Build.opt_list lns comma
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let record = [ seq "mntent" .
|
|
Packit Service |
a2ae7a |
Util.indent .
|
|
Packit Service |
a2ae7a |
[ label "spec" . store spec ] . sep_tab .
|
|
Packit Service |
a2ae7a |
[ label "file" . store file ] . sep_tab .
|
|
Packit Service |
a2ae7a |
comma_sep_list "vfstype" .
|
|
Packit Service |
a2ae7a |
(sep_tab . comma_sep_list "opt" .
|
|
Packit Service |
a2ae7a |
(sep_tab . [ label "dump" . store /[0-9]+/ ] .
|
|
Packit Service |
a2ae7a |
( sep_spc . [ label "passno" . store /[0-9]+/ ])? )? )?
|
|
Packit Service |
a2ae7a |
. Util.comment_or_eol ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let lns = ( empty | comment | record ) *
|
|
Packit Service |
a2ae7a |
let filter = incl "/etc/fstab"
|
|
Packit Service |
a2ae7a |
. incl "/etc/mtab"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns filter
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* Local Variables: *)
|
|
Packit Service |
a2ae7a |
(* mode: caml *)
|
|
Packit Service |
a2ae7a |
(* End: *)
|