On 21/09/12 21:51, Serge Hallyn wrote:
> @Dominic
> 
> they are pasted into comment #3.

Apologies, I hadn't refreshed.

> I was able to reproduce this in debian sid with that same file, so have
> filed a debian bug (waiting for a reply with the bug#)

I've fixed this upstream in commit e599fed9, patch attached if you want
to apply it.

http://git.fedorahosted.org/cgit/augeas.git/commit/?id=e599fed9

Regards,

-- 
Dominic Cleal
domi...@computerkb.co.uk
commit e599fed9206b8d0cf43773073774bf731b3a296a
Author: Dominic Cleal <dcl...@redhat.com>
Date:   Fri Sep 21 23:06:14 2012 +0100

    Modprobe: support multiline split commands
    
    Fixes Ubuntu bug #1054306

diff --git a/lenses/modprobe.aug b/lenses/modprobe.aug
index 834818d..f47ca12 100644
--- a/lenses/modprobe.aug
+++ b/lenses/modprobe.aug
@@ -41,8 +41,8 @@ let sto_no_spaces = store /[^# \t\n\\\\]+/
 (* View: sto_no_colons *)
 let sto_no_colons = store /[^:# \t\n\\\\]+/
 
-(* View: sto_to_eol *)
-let sto_to_eol = store /[^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\]/
+(* View: sto_multiline *)
+let sto_multiline = store /(([^# \t\n\\\\][^#\n\\\\]*[ \t]*\\\\[ \t]*\n[ \t]*)*([^# \t\n\\\\][^#\n\\\\]*[^# \t\n\\\\]|[^# \t\n\\\\])|[^# \t\n\\\\])/
 
 (* View: alias *)
 let alias =
@@ -64,7 +64,7 @@ let options =
 
 (* View: install_remove *)
 let kv_line_command (kw:regexp) =
-  let command = [ label "command" . sto_to_eol ] in
+  let command = [ label "command" . sto_multiline ] in
   [ key kw . sep_space . sto_no_spaces
                          . sep_space . command . Util.comment_or_eol ]
 
diff --git a/lenses/tests/test_modprobe.aug b/lenses/tests/test_modprobe.aug
index 915da4c..30a7bce 100644
--- a/lenses/tests/test_modprobe.aug
+++ b/lenses/tests/test_modprobe.aug
@@ -129,3 +129,19 @@ test Modprobe.entry get options_space_quote =
 test Modprobe.entry get "options ipv6 disable = 1\n" =
   { "options" = "ipv6"
     { "disable" = "1" } }
+
+(* Support multiline split commands, Ubuntu bug #1054306 *)
+test Modprobe.lns get "# /etc/modprobe.d/iwlwifi.conf
+# iwlwifi will dyamically load either iwldvm or iwlmvm depending on the
+# microcode file installed on the system. When removing iwlwifi, first
+# remove the iwl?vm module and then iwlwifi.
+remove iwlwifi \
+(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \
+&& /sbin/modprobe -r mac80211\n" =
+  { "#comment" = "/etc/modprobe.d/iwlwifi.conf" }
+  { "#comment" = "iwlwifi will dyamically load either iwldvm or iwlmvm depending on the" }
+  { "#comment" = "microcode file installed on the system. When removing iwlwifi, first" }
+  { "#comment" = "remove the iwl?vm module and then iwlwifi." }
+  { "remove" = "iwlwifi"
+    { "command" = "(/sbin/lsmod | grep -o -e ^iwlmvm -e ^iwldvm -e ^iwlwifi | xargs /sbin/rmmod) \\\n&& /sbin/modprobe -r mac80211" }
+  }

Reply via email to