0cd1190
From 781fdebda1d9e62e224630efb8d4dd5da8fe5f69 Mon Sep 17 00:00:00 2001
0cd1190
From: Alexander Scheel <alexander.m.scheel@gmail.com>
0cd1190
Date: Mon, 30 Oct 2017 12:43:19 -0500
0cd1190
Subject: [PATCH] INI: Silence ini_augment match failures
0cd1190
MIME-Version: 1.0
0cd1190
Content-Type: text/plain; charset=UTF-8
0cd1190
Content-Transfer-Encoding: 8bit
0cd1190
0cd1190
Resolves:
0cd1190
https://pagure.io/SSSD/ding-libs/issue/3182
0cd1190
0cd1190
Reviewed-by: Michal Židek <mzidek@redhat.com>
0cd1190
Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
0cd1190
Merges: https://pagure.io/SSSD/ding-libs/pull-request/3183
0cd1190
(cherry picked from commit be9ca3a2c26b061d1f22bd4a09009bba7a01f67b)
0cd1190
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
0cd1190
---
0cd1190
 ini/ini.d/merge.validator | 11 -----------
0cd1190
 ini/ini_augment.c         | 13 +++++++------
0cd1190
 2 files changed, 7 insertions(+), 17 deletions(-)
0cd1190
0cd1190
diff --git a/ini/ini.d/merge.validator b/ini/ini.d/merge.validator
0cd1190
index 1defe8e..017c1cb 100644
0cd1190
--- a/ini/ini.d/merge.validator
0cd1190
+++ b/ini/ini.d/merge.validator
0cd1190
@@ -1,17 +1,8 @@
0cd1190
-File %s%s/merge.validator did not match provided patterns. Skipping.
0cd1190
-File %s%s/real8.conf did not match provided patterns. Skipping.
0cd1190
-File %s%s/new_line.conf did not match provided patterns. Skipping.
0cd1190
-File %s%s/real32be.conf did not match provided patterns. Skipping.
0cd1190
-File %s%s/real32le.conf did not match provided patterns. Skipping.
0cd1190
-File %s%s/real16be.conf did not match provided patterns. Skipping.
0cd1190
-File %s%s/real16le.conf did not match provided patterns. Skipping.
0cd1190
-File %s%s/foo.conf.in did not match provided patterns. Skipping.
0cd1190
 Errors detected while parsing: %s%s/comment.conf.
0cd1190
 Error (9) on line 22: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 24: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 26: Invalid space character at the beginning of the line.
0cd1190
 Error (15) on line 32: Incomplete comment at the end of the file.
0cd1190
-No sections found in file %s%s/comment.conf. Skipping.
0cd1190
 Section [section_a] found in file %s%s/first.conf is not allowed.
0cd1190
 Section [section_c] found in file %s%s/first.conf is not allowed.
0cd1190
 Section [section_b] found in file %s%s/first.conf is not allowed.
0cd1190
@@ -42,7 +33,6 @@ Error (9) on line 1: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 2: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 3: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 4: Invalid space character at the beginning of the line.
0cd1190
-No sections found in file %s%s/space.conf. Skipping.
0cd1190
 Section [info] found in file %s%s/symbols.conf is not allowed.
0cd1190
 Section [languages] found in file %s%s/symbols.conf is not allowed.
0cd1190
 Section [text] found in file %s%s/symbols.conf is not allowed.
0cd1190
@@ -55,6 +45,5 @@ Error (9) on line 15: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 16: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 26: Invalid space character at the beginning of the line.
0cd1190
 Error (9) on line 35: Invalid space character at the beginning of the line.
0cd1190
-No sections found in file %s%s/test.conf. Skipping.
0cd1190
 %s%s/ipa.conf
0cd1190
 %s%s/real.conf
0cd1190
diff --git a/ini/ini_augment.c b/ini/ini_augment.c
0cd1190
index af5c0b6..9d83ad9 100644
0cd1190
--- a/ini/ini_augment.c
0cd1190
+++ b/ini/ini_augment.c
0cd1190
@@ -32,6 +32,8 @@
0cd1190
 #include <sys/types.h>
0cd1190
 #include <regex.h>
0cd1190
 #include <unistd.h>
0cd1190
+#define TRACE_LEVEL 7
0cd1190
+#define TRACE_HOME
0cd1190
 #include "trace.h"
0cd1190
 #include "collection.h"
0cd1190
 #include "collection_tools.h"
0cd1190
@@ -456,10 +458,9 @@ static int ini_aug_construct_list(char *dirname ,
0cd1190
             }
0cd1190
         }
0cd1190
         else {
0cd1190
-            ini_aug_add_string(ra_err,
0cd1190
-                               "File %s did not match provided patterns."
0cd1190
-                               " Skipping.",
0cd1190
-                               fullname);
0cd1190
+            TRACE_INFO_STRING("File did not match provided patterns."
0cd1190
+                              " Skipping:",
0cd1190
+                              fullname);
0cd1190
         }
0cd1190
     }
0cd1190
 
0cd1190
@@ -609,8 +610,8 @@ static int ini_aug_match_sec(struct ini_cfgobj *snip_cfg,
0cd1190
 
0cd1190
     /* Just in case check that we processed anything */
0cd1190
     if (section_count == 0) {
0cd1190
-        ini_aug_add_string(ra_err, "No sections found in file %s. Skipping.",
0cd1190
-                           snip_name);
0cd1190
+        TRACE_INFO_STRING("No sections found in file. Skipping:",
0cd1190
+                          snip_name);
0cd1190
         *skip = true;
0cd1190
         TRACE_FLOW_EXIT();
0cd1190
         return EOK;