[augeas-devel] [PATCH] Fix two problems in the grub lens

David Lutterkort dlutter at redhat.com
Fri Jun 13 20:00:03 UTC 2008


2 files changed, 5 insertions(+), 1 deletion(-)
lenses/grub.aug            |    3 ++-
lenses/tests/test_grub.aug |    3 +++


# HG changeset patch
# User David Lutterkort <dlutter at redhat.com>
# Date 1213387199 25200
# Node ID 71fd576d8346eeb14d369ce750e58ec17250667a
# Parent  47e371f83a0fba5093906783a55418ef27610079
Fix two problems in the grub lens

(1) The grub lens did not handle blank lines
(2) Ubuntu uses 'quiet' in its boot stanzas, which we didn't know about

Reported by Jason Dobies

diff -r 47e371f83a0f -r 71fd576d8346 lenses/grub.aug
--- a/lenses/grub.aug	Fri Jun 13 12:55:24 2008 -0700
+++ b/lenses/grub.aug	Fri Jun 13 12:59:59 2008 -0700
@@ -35,11 +35,12 @@
     let boot_setting = kw_boot_arg "root"
                      | kw_boot_arg "kernel"
                      | kw_boot_arg "initrd"
+                     | kw_pres "quiet"  (* Seems to be a Ubuntu extension *)
                      | module_lines
 
     let boot = [ label "title" . title . boot_setting* ]
 
-    let comment = [ del /#.*\n/ "# " ]
+    let comment = [ del /(#.*|[ \t]*)\n/ "# " ]
 
     let lns = (comment | menu_setting | boot)*
     let xfm = transform lns (incl "/etc/grub.conf")
diff -r 47e371f83a0f -r 71fd576d8346 lenses/tests/test_grub.aug
--- a/lenses/tests/test_grub.aug	Fri Jun 13 12:55:24 2008 -0700
+++ b/lenses/tests/test_grub.aug	Fri Jun 13 12:59:59 2008 -0700
@@ -58,6 +58,9 @@
 
   test Grub.lns put conf after set "default" "0" = conf
 
+  test Grub.lns get "# menu.lst - See: grub(8), info grub, update-grub(8)
+
+## default num\n" = {} {} {}
 
 (* Local Variables: *)
 (* mode: caml       *)




More information about the augeas-devel mailing list