File 2686edf4-iproute2-hex-ids.patch of Package augeas.6793

From 2686edf4bcc0a2110ef5a2e8c01045ab0081b04e Mon Sep 17 00:00:00 2001
From: Dominic Cleal <dcleal@redhat.com>
Date: Wed, 12 Feb 2014 09:49:03 +0000
Subject: [PATCH] IPRoute2: handle hex IDs and hyphens in names, as present in
 rt_dsfield

Fixes RHBZ#1063961
---
 lenses/iproute2.aug            |  3 ++-
 lenses/tests/test_iproute2.aug | 10 ++++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)

Index: augeas-1.2.0/lenses/iproute2.aug
===================================================================
--- augeas-1.2.0.orig/lenses/iproute2.aug
+++ augeas-1.2.0/lenses/iproute2.aug
@@ -2,7 +2,8 @@ module IPRoute2 =
   autoload xfm
 
   let empty   = [ del /[ \t]*#?[ \t]*\n/ "\n" ]
-  let record = [ store /[0-9]+/ . del /[ \t]+/ "\t" . key /[a-zA-Z0-9]+/ . Util.comment_or_eol ]
+  let id = Rx.hex | Rx.integer
+  let record = [ store id . del /[ \t]+/ "\t" . key /[a-zA-Z0-9-]+/ . Util.comment_or_eol ]
 
   let lns = ( empty | Util.comment | record ) *
 
Index: augeas-1.2.0/lenses/tests/test_iproute2.aug
===================================================================
--- augeas-1.2.0.orig/lenses/tests/test_iproute2.aug
+++ augeas-1.2.0/lenses/tests/test_iproute2.aug
@@ -19,6 +19,11 @@ let conf = "
 203	adsl3
 204	adsl4
 205	wifi0
+#
+# From rt_dsfield
+#
+0x00  default
+0x80  flash-override
 "
 
 test IPRoute2.lns get conf =
@@ -41,3 +46,8 @@ test IPRoute2.lns get conf =
   { "adsl3" = "203" }
   { "adsl4" = "204" }
   { "wifi0" = "205" }
+  { }
+  { "#comment" = "From rt_dsfield" }
+  { }
+  { "default" = "0x00" }
+  { "flash-override" = "0x80" }
openSUSE Build Service is sponsored by