Blame SOURCES/0013-ras-mc-ctl-Improve-parser.patch

97e186
From 099af4056912faa28bf1385fffa77e7bbb468b93 Mon Sep 17 00:00:00 2001
97e186
From: Mauro Carvalho Chehab <m.chehab@samsung.com>
97e186
Date: Thu, 15 Aug 2013 12:43:02 -0300
97e186
Subject: [PATCH 13/32] ras-mc-ctl: Improve parser
97e186
97e186
Accept either . or : as layers separator at config files.
97e186
97e186
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
97e186
---
97e186
 util/ras-mc-ctl.in |    4 ++--
97e186
 1 files changed, 2 insertions(+), 2 deletions(-)
97e186
97e186
diff --git a/util/ras-mc-ctl.in b/util/ras-mc-ctl.in
97e186
index 48d9b00..f5a8ce5 100755
97e186
--- a/util/ras-mc-ctl.in
97e186
+++ b/util/ras-mc-ctl.in
97e186
@@ -481,14 +481,14 @@ sub parse_dimm_labels_file
97e186
 
97e186
             next unless (my ($label, $info) = ($str =~ /^(.*)\s*:\s*(.*)$/i));
97e186
 
97e186
-            unless ($info =~ /\d+(?:\.\d+)*/) {
97e186
+            unless ($info =~ /\d+(?:[\.\:]\d+)*/) {
97e186
                 log_error ("$file: $line: Invalid syntax, ignoring: \"$_\"\n");
97e186
                 next;
97e186
             }
97e186
 
97e186
             for my $target (split (/[, ]+/, $info)) {
97e186
                 my $n;
97e186
-                my ($mc, $top, $mid, $low, $extra) = ($target =~ /(\d+)(?:\.(\d+)){0,1}(?:\.(\d+)){0,1}(?:\.(\d+)){0,1}(?:\.(\d+)){0,1}/);
97e186
+                my ($mc, $top, $mid, $low, $extra) = ($target =~ /(\d+)(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}(?:[\.\:](\d+)){0,1}/);
97e186
 
97e186
                 if (defined($extra)) {
97e186
                         die ("Error: Only up to 3 layers are currently supported on label db \"$file\"\n");
97e186
-- 
97e186
1.7.1
97e186