Compare commits
10 Commits
5728972c45
...
535f8a6315
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
535f8a6315 | ||
|
|
4b72399a66 | ||
|
|
81f3c371a3 | ||
|
|
0b7dca94f2 | ||
|
|
f868d35f36 | ||
|
|
6167c0502a | ||
|
|
003fdb3a19 | ||
|
|
00881cc32a | ||
|
|
573c1fe1f7 | ||
|
|
82ce21ff65 |
Binary file not shown.
BIN
2024-02-01.tar.gz
Normal file
BIN
2024-02-01.tar.gz
Normal file
Binary file not shown.
42
add-some-testcases-for-abnormal-branches.patch
Normal file
42
add-some-testcases-for-abnormal-branches.patch
Normal 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
|
||||
|
||||
32
re2.spec
32
re2.spec
@ -1,11 +1,12 @@
|
||||
Name: re2
|
||||
Version: 20211101
|
||||
Version: 20240201
|
||||
Release: 1
|
||||
Summary: Provide backtracking RE engine
|
||||
License: BSD
|
||||
URL: http://github.com/google/re2/
|
||||
Source0: https://github.com/google/re2/archive/2021-11-01.tar.gz
|
||||
BuildRequires: gcc-c++
|
||||
Source0: https://github.com/google/re2/archive/2024-02-01.tar.gz
|
||||
Patch1: add-some-testcases-for-abnormal-branches.patch
|
||||
BuildRequires: gcc-c++ abseil-cpp-devel
|
||||
|
||||
%description
|
||||
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.
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-2021-11-01 -p1
|
||||
%autosetup -n %{name}-2024-02-01 -p1
|
||||
|
||||
%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" \
|
||||
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}
|
||||
|
||||
%check
|
||||
make %{?_smp_mflags} shared-test
|
||||
export LD_LIBRARY_PATH=%{buildroot}/%{_libdir}:LD_LIBRARY_PATH
|
||||
%ctest || true
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
@ -40,7 +43,7 @@ make %{?_smp_mflags} shared-test
|
||||
/sbin/ldconfig
|
||||
|
||||
%files
|
||||
%doc AUTHORS CONTRIBUTORS README LICENSE
|
||||
%doc README LICENSE
|
||||
%{_libdir}/lib%{name}.so.*
|
||||
|
||||
%files devel
|
||||
@ -49,6 +52,21 @@ make %{?_smp_mflags} shared-test
|
||||
%exclude %{_libdir}/libre2.a
|
||||
|
||||
%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
|
||||
- upgrade to 20211101
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user