Package init
This commit is contained in:
commit
35cf4d053b
47
INI-Fix-detection-of-error-messages.patch
Normal file
47
INI-Fix-detection-of-error-messages.patch
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
From 72c19bd018b107ecf5a80963b433e9922f7243fd Mon Sep 17 00:00:00 2001
|
||||||
|
From: Lukas Slebodnik <lslebodn@redhat.com>
|
||||||
|
Date: Wed, 3 Jan 2018 18:03:44 +0100
|
||||||
|
Subject: [PATCH 01/11] INI: Fix detection of error messages
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
libc on BSD returns different error messages.
|
||||||
|
|
||||||
|
Reviewed-by: Michal Židek <mzidek@redhat.com>
|
||||||
|
---
|
||||||
|
ini/ini_validators_ut_check.c | 11 +++++++++++
|
||||||
|
1 file changed, 11 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/ini/ini_validators_ut_check.c b/ini/ini_validators_ut_check.c
|
||||||
|
index fa7105a..9ecde75 100644
|
||||||
|
--- a/ini/ini_validators_ut_check.c
|
||||||
|
+++ b/ini/ini_validators_ut_check.c
|
||||||
|
@@ -607,6 +607,12 @@ START_TEST(test_ini_allowed_options_wrong_regex)
|
||||||
|
"[rule/options_for_foo]: Cannot compile regular expression "
|
||||||
|
"from option 'section_re'. "
|
||||||
|
"Error: 'Unmatched [ or [^'");
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ ret = strcmp(errmsg,
|
||||||
|
+ "[rule/options_for_foo]: Cannot compile regular expression "
|
||||||
|
+ "from option 'section_re'. "
|
||||||
|
+ "Error: 'brackets ([ ]) not balanced'");
|
||||||
|
+ }
|
||||||
|
fail_unless(ret == 0, "Got msg: [%s]", errmsg);
|
||||||
|
ini_errobj_next(errobj);
|
||||||
|
|
||||||
|
@@ -1028,6 +1034,11 @@ START_TEST(test_ini_allowed_sections_wrong_regex)
|
||||||
|
ret = strcmp(errmsg,
|
||||||
|
"[rule/section_list]: Validator failed to use regex "
|
||||||
|
"[^foo\\(*$]:[Unmatched ( or \\(]");
|
||||||
|
+ if (ret !=0) {
|
||||||
|
+ ret = strcmp(errmsg,
|
||||||
|
+ "[rule/section_list]: Validator failed to use regex "
|
||||||
|
+ "[^foo\\(*$]:[parentheses not balanced]");
|
||||||
|
+ }
|
||||||
|
fail_unless(ret == 0, "Got msg: [%s]", errmsg);
|
||||||
|
ini_errobj_next(errobj);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.9.5
|
||||||
|
|
||||||
34
INI-Remove-definiton-of-TRACE_LEVEL.patch
Normal file
34
INI-Remove-definiton-of-TRACE_LEVEL.patch
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
From 8509cfaa757c0f8cc4d79357613f46d2fd9ee878 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
|
||||||
|
Date: Wed, 15 Nov 2017 18:31:47 +0100
|
||||||
|
Subject: [PATCH] INI: Remove definiton of TRACE_LEVEL
|
||||||
|
|
||||||
|
Macros TRACE_LEVEL 7 and TRACE_HOME should only be defined
|
||||||
|
in testing builds where we want debug messages to be generated.
|
||||||
|
|
||||||
|
The macros are leftovers from the previous patch where they
|
||||||
|
were improperly added for debug purposes.
|
||||||
|
|
||||||
|
Resolves:
|
||||||
|
https://pagure.io/SSSD/ding-libs/issue/3182
|
||||||
|
|
||||||
|
Reviewed-by: Robbie Harwood <rharwood@redhat.com>
|
||||||
|
(cherry picked from commit a731d8c8c515e7e42a4fb448e0ecb6934d5bf99b)
|
||||||
|
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
|
||||||
|
---
|
||||||
|
ini/ini_augment.c | 2 --
|
||||||
|
1 file changed, 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ini/ini_augment.c b/ini/ini_augment.c
|
||||||
|
index 9d83ad9..5a5a173 100644
|
||||||
|
--- a/ini/ini_augment.c
|
||||||
|
+++ b/ini/ini_augment.c
|
||||||
|
@@ -32,8 +32,6 @@
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <regex.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
-#define TRACE_LEVEL 7
|
||||||
|
-#define TRACE_HOME
|
||||||
|
#include "trace.h"
|
||||||
|
#include "collection.h"
|
||||||
|
#include "collection_tools.h"
|
||||||
96
INI-Silence-ini_augment-match-failures.patch
Normal file
96
INI-Silence-ini_augment-match-failures.patch
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
From 781fdebda1d9e62e224630efb8d4dd5da8fe5f69 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alexander Scheel <alexander.m.scheel@gmail.com>
|
||||||
|
Date: Mon, 30 Oct 2017 12:43:19 -0500
|
||||||
|
Subject: [PATCH] INI: Silence ini_augment match failures
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Resolves:
|
||||||
|
https://pagure.io/SSSD/ding-libs/issue/3182
|
||||||
|
|
||||||
|
Reviewed-by: Michal Židek <mzidek@redhat.com>
|
||||||
|
Signed-off-by: Alexander Scheel <alexander.m.scheel@gmail.com>
|
||||||
|
Merges: https://pagure.io/SSSD/ding-libs/pull-request/3183
|
||||||
|
(cherry picked from commit be9ca3a2c26b061d1f22bd4a09009bba7a01f67b)
|
||||||
|
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
|
||||||
|
---
|
||||||
|
ini/ini.d/merge.validator | 11 -----------
|
||||||
|
ini/ini_augment.c | 13 +++++++------
|
||||||
|
2 files changed, 7 insertions(+), 17 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ini/ini.d/merge.validator b/ini/ini.d/merge.validator
|
||||||
|
index 1defe8e..017c1cb 100644
|
||||||
|
--- a/ini/ini.d/merge.validator
|
||||||
|
+++ b/ini/ini.d/merge.validator
|
||||||
|
@@ -1,17 +1,8 @@
|
||||||
|
-File %s%s/merge.validator did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/real8.conf did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/new_line.conf did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/real32be.conf did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/real32le.conf did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/real16be.conf did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/real16le.conf did not match provided patterns. Skipping.
|
||||||
|
-File %s%s/foo.conf.in did not match provided patterns. Skipping.
|
||||||
|
Errors detected while parsing: %s%s/comment.conf.
|
||||||
|
Error (9) on line 22: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 24: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 26: Invalid space character at the beginning of the line.
|
||||||
|
Error (15) on line 32: Incomplete comment at the end of the file.
|
||||||
|
-No sections found in file %s%s/comment.conf. Skipping.
|
||||||
|
Section [section_a] found in file %s%s/first.conf is not allowed.
|
||||||
|
Section [section_c] found in file %s%s/first.conf is not allowed.
|
||||||
|
Section [section_b] found in file %s%s/first.conf is not allowed.
|
||||||
|
@@ -42,7 +33,6 @@ Error (9) on line 1: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 2: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 3: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 4: Invalid space character at the beginning of the line.
|
||||||
|
-No sections found in file %s%s/space.conf. Skipping.
|
||||||
|
Section [info] found in file %s%s/symbols.conf is not allowed.
|
||||||
|
Section [languages] found in file %s%s/symbols.conf is not allowed.
|
||||||
|
Section [text] found in file %s%s/symbols.conf is not allowed.
|
||||||
|
@@ -55,6 +45,5 @@ Error (9) on line 15: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 16: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 26: Invalid space character at the beginning of the line.
|
||||||
|
Error (9) on line 35: Invalid space character at the beginning of the line.
|
||||||
|
-No sections found in file %s%s/test.conf. Skipping.
|
||||||
|
%s%s/ipa.conf
|
||||||
|
%s%s/real.conf
|
||||||
|
diff --git a/ini/ini_augment.c b/ini/ini_augment.c
|
||||||
|
index af5c0b6..9d83ad9 100644
|
||||||
|
--- a/ini/ini_augment.c
|
||||||
|
+++ b/ini/ini_augment.c
|
||||||
|
@@ -32,6 +32,8 @@
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <regex.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
+#define TRACE_LEVEL 7
|
||||||
|
+#define TRACE_HOME
|
||||||
|
#include "trace.h"
|
||||||
|
#include "collection.h"
|
||||||
|
#include "collection_tools.h"
|
||||||
|
@@ -456,10 +458,9 @@ static int ini_aug_construct_list(char *dirname ,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
- ini_aug_add_string(ra_err,
|
||||||
|
- "File %s did not match provided patterns."
|
||||||
|
- " Skipping.",
|
||||||
|
- fullname);
|
||||||
|
+ TRACE_INFO_STRING("File did not match provided patterns."
|
||||||
|
+ " Skipping:",
|
||||||
|
+ fullname);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -609,8 +610,8 @@ static int ini_aug_match_sec(struct ini_cfgobj *snip_cfg,
|
||||||
|
|
||||||
|
/* Just in case check that we processed anything */
|
||||||
|
if (section_count == 0) {
|
||||||
|
- ini_aug_add_string(ra_err, "No sections found in file %s. Skipping.",
|
||||||
|
- snip_name);
|
||||||
|
+ TRACE_INFO_STRING("No sections found in file. Skipping:",
|
||||||
|
+ snip_name);
|
||||||
|
*skip = true;
|
||||||
|
TRACE_FLOW_EXIT();
|
||||||
|
return EOK;
|
||||||
49
TEST-validators_ut_check-Fix-fail-with-new-glibc.patch
Normal file
49
TEST-validators_ut_check-Fix-fail-with-new-glibc.patch
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
From 9f9a3ded23cc2bb917468939b745cc498cec523a Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
|
||||||
|
Date: Wed, 1 Aug 2018 17:48:10 +0200
|
||||||
|
Subject: [PATCH] validators_ut_check: Fix fail with new glibc
|
||||||
|
|
||||||
|
Error message was slightly change from previous version
|
||||||
|
of glibc which caused fails in validators unit tests.
|
||||||
|
|
||||||
|
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
||||||
|
---
|
||||||
|
ini/ini_validators_ut_check.c | 13 +++++++++++--
|
||||||
|
1 file changed, 11 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/ini/ini_validators_ut_check.c b/ini/ini_validators_ut_check.c
|
||||||
|
index 9ecde75..3af8551 100644
|
||||||
|
--- a/ini/ini_validators_ut_check.c
|
||||||
|
+++ b/ini/ini_validators_ut_check.c
|
||||||
|
@@ -602,6 +602,8 @@ START_TEST(test_ini_allowed_options_wrong_regex)
|
||||||
|
fail_unless(ret == 0, "Got msg: [%s]", errmsg);
|
||||||
|
ini_errobj_next(errobj);
|
||||||
|
|
||||||
|
+ /* Different versions of libc produce slightly different error strings
|
||||||
|
+ * in this case. For simplicity compare against all of them. */
|
||||||
|
errmsg = ini_errobj_get_msg(errobj);
|
||||||
|
ret = strcmp(errmsg,
|
||||||
|
"[rule/options_for_foo]: Cannot compile regular expression "
|
||||||
|
@@ -609,10 +611,17 @@ START_TEST(test_ini_allowed_options_wrong_regex)
|
||||||
|
"Error: 'Unmatched [ or [^'");
|
||||||
|
if (ret != 0) {
|
||||||
|
ret = strcmp(errmsg,
|
||||||
|
- "[rule/options_for_foo]: Cannot compile regular expression "
|
||||||
|
- "from option 'section_re'. "
|
||||||
|
+ "[rule/options_for_foo]: Cannot compile regular "
|
||||||
|
+ "expression from option 'section_re'. "
|
||||||
|
"Error: 'brackets ([ ]) not balanced'");
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (ret != 0) {
|
||||||
|
+ ret = strcmp(errmsg,
|
||||||
|
+ "[rule/options_for_foo]: Cannot compile regular "
|
||||||
|
+ "expression from option 'section_re'. "
|
||||||
|
+ "Error: 'Unmatched [, [^, [:, [., or [='");
|
||||||
|
+ }
|
||||||
|
fail_unless(ret == 0, "Got msg: [%s]", errmsg);
|
||||||
|
ini_errobj_next(errobj);
|
||||||
|
|
||||||
|
--
|
||||||
|
2.9.5
|
||||||
|
|
||||||
BIN
ding-libs-0.6.1.tar.gz
Normal file
BIN
ding-libs-0.6.1.tar.gz
Normal file
Binary file not shown.
87
ding-libs.spec
Normal file
87
ding-libs.spec
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
%global Vpath_utils 0.2.1
|
||||||
|
%global Vdhash 0.5.0
|
||||||
|
%global Vref_array 0.1.5
|
||||||
|
%global Vcollection 0.7.0
|
||||||
|
%global Vbasicobjects 0.1.1
|
||||||
|
%global Vini_config 1.3.1
|
||||||
|
|
||||||
|
Name: ding-libs
|
||||||
|
Version: 0.6.1
|
||||||
|
Release: 42
|
||||||
|
Summary: 'Ding is not GLib' utility libraries
|
||||||
|
License: LGPLv3+
|
||||||
|
URL: https://pagure.io/SSSD/ding-libs
|
||||||
|
Source0: https://releases.pagure.org/SSSD/ding-libs/%{name}-%{version}.tar.gz
|
||||||
|
Patch0: INI-Silence-ini_augment-match-failures.patch
|
||||||
|
Patch1: INI-Remove-definiton-of-TRACE_LEVEL.patch
|
||||||
|
Patch2: INI-Fix-detection-of-error-messages.patch
|
||||||
|
Patch3: TEST-validators_ut_check-Fix-fail-with-new-glibc.patch
|
||||||
|
|
||||||
|
BuildRequires: autoconf,automake,check-devel,doxygen,gcc,git,libtool,m4,pkgconfig
|
||||||
|
Obsoletes: libpath_utils = %{Vpath_utils}, libdhash = %{Vdhash}, libref_array = %{Vref_array}
|
||||||
|
Obsoletes: libcollection = %{Vcollection}, libbasicobjects = %{Vbasicobjects}, libini_config = %{Vini_config}
|
||||||
|
Provides: libpath_utils = %{Vpath_utils}, libdhash = %{Vdhash}, libref_array = %{Vref_array}
|
||||||
|
Provides: libcollection = %{Vcollection}, libbasicobjects = %{Vbasicobjects}, libini_config = %{Vini_config}
|
||||||
|
|
||||||
|
%description
|
||||||
|
A meta-package that pulls in libcollection, libdhash, libini_config,
|
||||||
|
librefarray libbasicobjects, and libpath_utils.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: Development files for ding-libs
|
||||||
|
Requires: ding-libs = %{version}-%{release}
|
||||||
|
Provides: libpath_utils-devel,libdhash-devel,libref_array-devel
|
||||||
|
Provides: libcollection-devel,libbasicobjects-devel,libini_config-devel
|
||||||
|
Obsoletes: libpath_utils-devel,libdhash-devel,libref_array-devel
|
||||||
|
Obsoletes: libcollection-devel,libbasicobjects-devel,libini_config-devel
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
This package provides development libraries and other development files.
|
||||||
|
|
||||||
|
%package_help
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1 -Sgit
|
||||||
|
|
||||||
|
autoreconf -fiv
|
||||||
|
%build
|
||||||
|
%configure
|
||||||
|
%make_build all docs
|
||||||
|
|
||||||
|
%check
|
||||||
|
make check
|
||||||
|
|
||||||
|
%install
|
||||||
|
%makeinstall
|
||||||
|
|
||||||
|
rm -rf %{buildroot}%{_docdir}/%{name}/{README.*,examples/*.c}
|
||||||
|
|
||||||
|
mkdir -p %{buildroot}%{_docdir}/%{name}-help/{libpath_utils,libdhash,libref_array,\
|
||||||
|
libcollection,libbasicobjects,libini_config}
|
||||||
|
cp -pr path_utils/{README.path_utils,doc/html} %{buildroot}%{_docdir}/%{name}-help/libpath_utils/
|
||||||
|
cp -pr dhash/{README.dhash,examples/*.c} %{buildroot}%{_docdir}/%{name}-help/libdhash/
|
||||||
|
cp -pr refarray/{README.ref_array,doc/html} %{buildroot}%{_docdir}/%{name}-help/libref_array/
|
||||||
|
cp -pr collection/doc/html %{buildroot}%{_docdir}/%{name}-help/libcollection/
|
||||||
|
cp -pr basicobjects/doc/html %{buildroot}%{_docdir}/%{name}-help/libbasicobjects/
|
||||||
|
cp -pr ini/doc/html %{buildroot}%{_docdir}/%{name}-help/libini_config/
|
||||||
|
|
||||||
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
|
%files
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc COPYING COPYING.LESSER
|
||||||
|
%{_libdir}/lib*.so.*
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_includedir}/*
|
||||||
|
%{_libdir}/lib*.{a,la,so}
|
||||||
|
%{_libdir}/pkgconfig/*
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%{_docdir}/%{name}-help/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Sep 06 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.6.1-42
|
||||||
|
- Package Init
|
||||||
Loading…
x
Reference in New Issue
Block a user