[augeas-devel] [PATCH 1/2] Modprobe: Refactor to make re-use easier
Matthew Booth
mbooth at redhat.com
Thu May 13 09:03:33 UTC 2010
---
lenses/modprobe.aug | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/lenses/modprobe.aug b/lenses/modprobe.aug
index 7cfa2c9..bdecafb 100644
--- a/lenses/modprobe.aug
+++ b/lenses/modprobe.aug
@@ -33,10 +33,16 @@ let options =
let option = [ spc . key opt_ch+ . (del /=/ "=" . token)? ] in
[ cmd "options" . token . option* . eol ]
-let entry = [ cmd "alias" . token . spc . arg "modulename" . eol ]
- | [ cmd "include" . token . eol ]
+let alias = [ cmd "alias" . token . spc . arg "modulename" . eol ]
+
+let include = [ cmd "include" . token . eol ]
+
+let cmd_token_to_eol (n:regexp) = [ cmd n . token_to_eol . eol ]
+
+let entry = alias
+ | include
| options
- | [ cmd /install|remove/ . token_to_eol . eol ]
+ | cmd_token_to_eol /install|remove/
| [ cmd "blacklist" . token . eol ]
| [ cmd "config" . store /binary_indexes|yes|no/ ]
--
1.6.6.1
More information about the augeas-devel
mailing list