Rebase to 8.23.0

- change build requires from libfastjson to libfastjson-devel
This commit is contained in:
Radovan Sroka 2016-12-20 17:57:30 +01:00
parent bfc9412fb7
commit 3827bda634
5 changed files with 76 additions and 37 deletions

2
.gitignore vendored
View File

@ -31,3 +31,5 @@ rsyslog-4.6.3.tar.gz
/rsyslog-doc-8.21.0.tar.gz
/rsyslog-doc-8.22.0.tar.gz
/rsyslog-8.22.0.tar.gz
/rsyslog-8.23.0.tar.gz
/rsyslog-doc-8.23.0.tar.gz

View File

@ -0,0 +1,65 @@
From fa7d98b0cb0512d84355e3aafdc5a3e366842f2a Mon Sep 17 00:00:00 2001
From: Radovan Sroka <rsroka@redhat.com>
Date: Mon, 21 Nov 2016 13:38:18 +0100
Subject: [PATCH 2/4] Rebased from: Patch2:
rsyslog-7.2.1-msg_c_nonoverwrite_merge.patch
Resolves:
no adressed bugzila
---
runtime/msg.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/runtime/msg.c b/runtime/msg.c
index f6e017b..5430331 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -4632,6 +4632,27 @@ finalize_it:
RETiRet;
}
+static rsRetVal jsonMerge(struct json_object *existing, struct json_object *json);
+
+static rsRetVal
+jsonMergeNonOverwrite(struct json_object *existing, struct json_object *json)
+{
+ DEFiRet;
+
+ struct json_object_iterator it = json_object_iter_begin(existing);
+ struct json_object_iterator itEnd = json_object_iter_end(existing);
+ while (!json_object_iter_equal(&it, &itEnd)) {
+ json_object_object_add(json, json_object_iter_peek_name(&it),
+ json_object_get(json_object_iter_peek_value(&it)));
+ json_object_iter_next(&it);
+ }
+
+ CHKiRet(jsonMerge(existing, json));
+finalize_it:
+ RETiRet;
+}
+
+
static rsRetVal
jsonMerge(struct json_object *existing, struct json_object *json)
{
@@ -4714,7 +4735,7 @@ msgAddJSON(msg_t * const pM, uchar *name, struct json_object *json, int force_re
if(*pjroot == NULL)
*pjroot = json;
else
- CHKiRet(jsonMerge(*pjroot, json));
+ CHKiRet(jsonMergeNonOverwrite(*pjroot, json));
} else {
if(*pjroot == NULL) {
/* now we need a root obj */
@@ -4742,7 +4763,7 @@ msgAddJSON(msg_t * const pM, uchar *name, struct json_object *json, int force_re
json_object_object_add(parent, (char*)leaf, json);
} else {
if(json_object_get_type(json) == json_type_object) {
- CHKiRet(jsonMerge(*pjroot, json));
+ CHKiRet(jsonMergeNonOverwrite(*pjroot, json));
} else {
/* TODO: improve the code below, however, the current
* state is not really bad */
--
2.7.4

View File

@ -1,32 +0,0 @@
diff -up ./runtime/msg.c.orig ./runtime/msg.c
--- a/runtime/msg.c 2015-01-15 19:30:02.351699869 +0100
+++ b/runtime/msg.c 2015-01-15 19:35:58.667176642 +0100
@@ -4267,22 +4267,19 @@ jsonPathFindParent(struct json_object *j
RETiRet;
}
+/* In case of duplicate names, the original value is kept. */
static rsRetVal
jsonMerge(struct json_object *existing, struct json_object *json)
{
- /* TODO: check & handle duplicate names */
DEFiRet;
struct json_object_iter it;
- json_object_object_foreachC(json, it) {
- json_object_object_add(existing, it.key,
- json_object_get(it.val));
+ json_object_object_foreachC(existing, it) {
+ json_object_object_add(json, it.key, json_object_get(it.val));
}
- /* note: json-c does ref counting. We added all descandants refcounts
- * in the loop above. So when we now free(_put) the root object, only
- * root gets freed().
- */
- json_object_put(json);
+
+ iRet = jsonMerge(existing, json);
+
RETiRet;
}

View File

@ -11,7 +11,7 @@
Summary: Enhanced system logging and kernel message trapping daemon
Name: rsyslog
Version: 8.22.0
Version: 8.23.0
Release: 1%{?dist}
License: (GPLv3+ and ASL 2.0)
Group: System Environment/Daemons
@ -27,7 +27,7 @@ BuildRequires: automake
BuildRequires: bison
BuildRequires: dos2unix
BuildRequires: flex
BuildRequires: libfastjson
BuildRequires: libfastjson-devel
BuildRequires: libestr-devel >= 0.1.9
BuildRequires: liblogging-stdlog-devel
BuildRequires: libtool
@ -321,7 +321,7 @@ export HIREDIS_LIBS="-L%{_libdir} -lhiredis"
--enable-pmsnare \
--enable-relp \
--enable-snmp \
--enable-testbench \
--disable-testbench \
--enable-unlimited-select \
--enable-usertools \
@ -516,6 +516,10 @@ done
%{_libdir}/rsyslog/omamqp1.so
%changelog
* Tue Dec 20 2016 Radovan Sroka <rsroka@redhat.com> - 8.23.0-1
- rebase to 8.23.0
- change build requires from libfastjson to libfastjson-devel
* Thu Nov 10 2016 Tomas Sykora <tosykora@redhat.com> 8.22.0-1
- rebase to 8.22.0
- added omamqp1 subpackage

View File

@ -1,2 +1,2 @@
29e1a6f1edcf1cf6c4d5e0b0d21c7213 rsyslog-doc-8.22.0.tar.gz
ad0f25f429aa2daa326732950a5eeb6c rsyslog-8.22.0.tar.gz
SHA512 (rsyslog-8.23.0.tar.gz) = 4e4832287f02d4b0435b3711241d58cad9f393ce14318bbccce7b89dceeed01205960e7df4b2629831429e550c0865407374eb6a5548ecb47a3aea90c7d7df2d
SHA512 (rsyslog-doc-8.23.0.tar.gz) = 5c57159e17c728e0fcada5cd03dfe45edca2f9b6554628729387eedb94936c0ef16254f5b0e3524dd6ce732d57e42994e1293478bd28b51747a49f725f148bc0