aboutsummaryrefslogtreecommitdiffstats
path: root/main/augeas/iface-multiopt.patch
blob: 68260a336e0d11dd590405dd09cc02dcc78f9eed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
--- augeas-1.1.0/lenses/interfaces.aug
+++ augeas-1.1.0.iface/lenses/interfaces.aug
@@ -36,21 +36,26 @@
 let stanza_id    (t:string) = key t . sep_spc . sto_to_spc
 let stanza_param (l:string) = [ sep_spc . label l . sto_to_spc ]
 
-(* Define reseverved words *)
-let stanza_word = /(iface|auto|allow-[a-z-]+|mapping)/
+(* Define reseverved words and multi-value options*)
+let stanza_word = /(iface|auto|allow-[a-z-]+|mapping|bond-slaves|bridge-ports)/
 
+(* Define stanza option indentation *)
+let stanza_indent = del /[ \t]*/ "   "
+
 (* Define additional lines for multi-line stanzas *)
-let stanza_option = [  del /[ \t]*/ "   "
+let stanza_option = [  stanza_indent
                      . key  ( /[a-z_-]+/ - stanza_word )
                      . sep_spc
                      . sto_to_eol ]
 
+(* Define space-separated array *)
+let array (r:regexp) (t:string) =  del r t . label t . counter t
+   . [ sep_spc . seq t . sto_to_spc ]+
+
 (************************************************************************
  *                              AUTO
  *************************************************************************)
 
-let array (r:regexp) (t:string) =  del r t . label t . counter t
-   . [ sep_spc . seq t . sto_to_spc ]+
 let auto = [ array /(allow-)?auto/ "auto" . eol ]
 
 (************************************************************************
@@ -74,12 +79,18 @@
  *                              IFACE
  *************************************************************************)
 
+let multi_option (t:string) = [ stanza_indent . array t t . eol ]
+
 let iface   = [ Util.indent
               . stanza_id    "iface"
               . stanza_param "family"
               . stanza_param "method"
               . eol
-              . (stanza_option|comment|empty)* ]
+              . ( stanza_option
+                | multi_option "bond-slaves"
+                | multi_option "bridge-ports"
+                | comment
+                | empty )* ]
 
 (************************************************************************
  *                              STANZAS