Blame SOURCES/0019-event-configuration-load-default-values-from-configu.patch

562801
From 70a804d6988a99ff85e4ca6e33ccc3de362cb74d Mon Sep 17 00:00:00 2001
562801
From: Jakub Filak <jfilak@redhat.com>
562801
Date: Thu, 6 Feb 2014 10:38:51 +0100
562801
Subject: [LIBREPORT PATCH 19/24] event configuration: load default values from
562801
 configuration directory
562801
562801
Load event configuration files from EVENT_CONF_DIR, where the files are
562801
actually placed, instead of EVENT_DIR, which contains on XML event
562801
definition files.
562801
562801
Closes rhbz#1062135
562801
562801
Signed-off-by: Jakub Filak <jfilak@redhat.com>
562801
---
562801
 augeas/libreport.aug   |  3 +++
562801
 src/lib/Makefile.am    |  1 +
562801
 src/lib/event_config.c | 10 +++++++++-
562801
 3 files changed, 13 insertions(+), 1 deletion(-)
562801
562801
diff --git a/augeas/libreport.aug b/augeas/libreport.aug
562801
index 431d3d2..3eba157 100644
562801
--- a/augeas/libreport.aug
562801
+++ b/augeas/libreport.aug
562801
@@ -20,7 +20,10 @@ module Libreport =
562801
     let lns = ( comment | empty | option )*
562801
 
562801
     let filter = (incl "/etc/libreport/plugins/*")
562801
+               . (incl "/etc/libreport/events/*")
562801
                . (incl (Sys.getenv("HOME") . "/.config/abrt/settings/*"))
562801
+               . (incl (Sys.getenv("XDG_CACHE_HOME") . "/abrt/events/*"))
562801
+               . (incl (Sys.getenv("HOME") . "/.cache/abrt/events/*"))
562801
                . Util.stdexcl
562801
 
562801
     let xfm = transform lns filter
562801
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
562801
index a8ae75c..ac173f6 100644
562801
--- a/src/lib/Makefile.am
562801
+++ b/src/lib/Makefile.am
562801
@@ -64,6 +64,7 @@ libreport_la_CPPFLAGS = \
562801
     -DPLUGINS_CONF_DIR=\"$(PLUGINS_CONF_DIR)\" \
562801
     -DCONF_DIR=\"$(CONF_DIR)\" \
562801
     -DEVENTS_DIR=\"$(EVENTS_DIR)\" \
562801
+    -DEVENTS_CONF_DIR=\"$(EVENTS_CONF_DIR)\" \
562801
     -DWORKFLOWS_DIR=\"$(WORKFLOWS_DIR)\" \
562801
     -DBIN_DIR=\"$(bindir)\" \
562801
     -DDEFAULT_DUMP_DIR_MODE=$(DEFAULT_DUMP_DIR_MODE) \
562801
diff --git a/src/lib/event_config.c b/src/lib/event_config.c
562801
index 169dd78..6d12695 100644
562801
--- a/src/lib/event_config.c
562801
+++ b/src/lib/event_config.c
562801
@@ -229,7 +229,15 @@ GHashTable *load_event_config_data(void)
562801
         event_files = g_list_delete_link(event_files, event_files);
562801
     }
562801
 
562801
-    load_config_files(EVENTS_DIR);
562801
+    /* EVENTS_DIR      -> /usr/share/libreport/events/$EVENT_NAME.xml
562801
+     *   - event xml definition files
562801
+     *
562801
+     * EVENTS_CONF_DIR -> /etc/libreport/events/$EVENT_NAME.conf
562801
+     *   - default values for xml definitions
562801
+     *
562801
+     * https://fedorahosted.org/abrt/wiki/AbrtConfiguration#Adjustingpluginconfiguration
562801
+     */
562801
+    load_config_files(EVENTS_CONF_DIR);
562801
 
562801
     char *cachedir;
562801
     cachedir = concat_path_file(g_get_user_cache_dir(), "abrt/events");
562801
-- 
562801
1.8.3.1
562801