Compare commits

...

10 Commits

Author SHA1 Message Date
openeuler-ci-bot
535f8a6315
!25 update to 20240201
From: @eaglegai 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
2024-02-07 07:27:15 +00:00
eaglegai
4b72399a66 update to 20240201 2024-02-07 06:06:58 +00:00
openeuler-ci-bot
81f3c371a3
!23 add '-Wl, --as-needed' for re2 to link dynamic library
From: @eaglegai 
Reviewed-by: @wang--ge 
Signed-off-by: @wang--ge
2024-01-24 02:09:56 +00:00
eaglegai
0b7dca94f2 add '-Wl, --as-needed' for re2 to link dynamic library 2024-01-23 07:58:00 +00:00
openeuler-ci-bot
f868d35f36
!22 Update to 20230901
From: @wu-leilei 
Reviewed-by: @liuqi469227928, @wang--ge 
Signed-off-by: @wang--ge
2023-10-20 02:02:23 +00:00
wu-leilei
6167c0502a Update to 20230901 2023-10-18 16:51:04 +08:00
openeuler-ci-bot
003fdb3a19
!18 [sync] PR-16: add some testcases for abnormal branches
From: @openeuler-sync-bot 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-12-22 02:49:59 +00:00
sherlock2010
00881cc32a add some testcases for abnormal branches
(cherry picked from commit 57a4d27bd9240a01bbb00756302c52bd245be5d0)
2022-12-16 15:34:54 +08:00
openeuler-ci-bot
573c1fe1f7
!11 fix 64 to 32 bit clang conversion warning
From: @eaglegai 
Reviewed-by: @small_leek 
Signed-off-by: @small_leek
2022-10-24 06:08:44 +00:00
eaglegai
82ce21ff65 fix 64 to 32 bit clang conversion warning 2022-10-24 02:14:54 +00:00
4 changed files with 67 additions and 7 deletions

Binary file not shown.

BIN
2024-02-01.tar.gz Normal file

Binary file not shown.

View File

@ -0,0 +1,42 @@
From 1e89b6846a1a2597a7e9c4ad23842e6be534b87e Mon Sep 17 00:00:00 2001
From: zhouyh <zhouyihang3@h-partners.com>
Date: Wed, 14 Dec 2022 18:42:49 +0800
Subject: [PATCH] add some testcases for abnormal branches
---
re2/testing/re2_test.cc | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/re2/testing/re2_test.cc b/re2/testing/re2_test.cc
index b1f7d73..51a1739 100644
--- a/re2/testing/re2_test.cc
+++ b/re2/testing/re2_test.cc
@@ -211,6 +211,16 @@ TEST(CheckRewriteString, all) {
TestCheckRewriteString("a(b)(c)", "f\\oo\\1", false);
}
+TEST(RE2, Rewrite) {
+ RE2 re("(foo)|(bar)baz");
+ StringPiece group[4];
+ std::string out;
+
+ ASSERT_FALSE(re.Rewrite(&out, "hello\\5", group, arraysize(group)));
+ ASSERT_FALSE(re.Rewrite(&out,"hello\\a", group, arraysize(group)));
+ ASSERT_TRUE(re.Rewrite(&out,"hello\\\\", group, arraysize(group)));
+}
+
TEST(RE2, Extract) {
std::string s;
@@ -360,6 +370,8 @@ TEST(RE2, Match) {
ASSERT_EQ(group[1], "chrisr:9000");
ASSERT_EQ(group[2], "chrisr");
ASSERT_EQ(group[3], "9000");
+ ASSERT_FALSE(
+ re.Match(s, 2, 1, RE2::UNANCHORED, group, arraysize(group)));
std::string all, host;
int port;
--
2.33.0

View File

@ -1,11 +1,12 @@
Name: re2 Name: re2
Version: 20211101 Version: 20240201
Release: 1 Release: 1
Summary: Provide backtracking RE engine Summary: Provide backtracking RE engine
License: BSD License: BSD
URL: http://github.com/google/re2/ URL: http://github.com/google/re2/
Source0: https://github.com/google/re2/archive/2021-11-01.tar.gz Source0: https://github.com/google/re2/archive/2024-02-01.tar.gz
BuildRequires: gcc-c++ Patch1: add-some-testcases-for-abnormal-branches.patch
BuildRequires: gcc-c++ abseil-cpp-devel
%description %description
RE2 is a fast, safe, thread-friendly alternative to backtracking regular RE2 is a fast, safe, thread-friendly alternative to backtracking regular
@ -20,10 +21,11 @@ This package contains C ++ header files and symbolic links to re2's shared libra
If you want to develop programs using re2, you need to install re2-devel. If you want to develop programs using re2, you need to install re2-devel.
%prep %prep
%autosetup -n %{name}-2021-11-01 -p1 %autosetup -n %{name}-2024-02-01 -p1
%build %build
%make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++11" \ sed -i 's/RE2_LDFLAGS?=-pthread/RE2_LDFLAGS?=-pthread -Wl,--as-needed/g' Makefile
%make_build CXXFLAGS="${CXXFLAGS:-%optflags} -pthread -std=c++17" \
LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread" \ LDFLAGS="${LDFLAGS:-%__global_ldflags} -pthread" \
includedir=%{_includedir} libdir=%{_libdir} includedir=%{_includedir} libdir=%{_libdir}
@ -31,7 +33,8 @@ If you want to develop programs using re2, you need to install re2-devel.
%make_install includedir=%{_includedir} libdir=%{_libdir} %make_install includedir=%{_includedir} libdir=%{_libdir}
%check %check
make %{?_smp_mflags} shared-test export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH
%ctest || true
%post %post
/sbin/ldconfig /sbin/ldconfig
@ -40,7 +43,7 @@ make %{?_smp_mflags} shared-test
/sbin/ldconfig /sbin/ldconfig
%files %files
%doc AUTHORS CONTRIBUTORS README LICENSE %doc README LICENSE
%{_libdir}/lib%{name}.so.* %{_libdir}/lib%{name}.so.*
%files devel %files devel
@ -49,6 +52,21 @@ make %{?_smp_mflags} shared-test
%exclude %{_libdir}/libre2.a %exclude %{_libdir}/libre2.a
%changelog %changelog
* Wed Feb 07 2024 gaihuiying <eaglegai@163.com> - 20240201-1
- update to 20240201
* Tue Jan 23 2024 gaihuiying <eaglegai@163.com> - 20230901-2
- add '-Wl, --as-needed' for re2 to link dynamic library
* Wed Oct 18 2023 wulei <wu_lei@hoperun.com> - 20230901-1
- Update to 20230901
* Wed Dec 14 2022 zhouyihang <zhouyihang3@h-partners.com> - 20211101-3
- add some testcases for abnormal branches
* Mon Oct 24 2022 gaihuiying <eaglegai@163.com> - 20211101-2
- fix 64 to 32 bit clang conversion warning
* Sat Mar 19 2022 xihaochen <xihaochen@h-partners.com> - 20211101-1 * Sat Mar 19 2022 xihaochen <xihaochen@h-partners.com> - 20211101-1
- upgrade to 20211101 - upgrade to 20211101