package/kodi: switch to pcre2
PATCH 1/1 package/kodi: switch to pcre2
Signed-off-by Bernd Kuhls <[email protected]>
--- .../0003-RegExp-remove-unused-methods.patch | 127 +++++ .../0004-Introduce-PCRE2-dependency.patch | 192 +++++++ ...igrate-PCRE-to-PCRE2-and-remove-PCRE.patch | 486 ++++++++++++++++++ package/kodi/Config.in | 3 +- package/kodi/kodi.mk | 2 +- 5 files changed, 807 insertions(+), 3 deletions(-) create mode 100644 package/kodi/0003-RegExp-remove-unused-methods.patch create mode 100644 package/kodi/0004-Introduce-PCRE2-dependency.patch create mode 100644 package/kodi/0005-Migrate-PCRE-to-PCRE2-and-remove-PCRE.patch
package/kodi/0003-RegExp-remove-unused-methods.patch new file +127 -0
@@ -0,0 +1,127 @@ +From 4dd017b2eae39356cda0d96a2f5743dbb8ccf299 Mon Sep 17 00:00:00 2001 +From: fuzzard <[email protected]> +Date: Sun, 2 Jun 2024 12:13:01 +1000 +Subject: [PATCH] RegExp remove unused methods + +Upstream: https://github.com/xbmc/xbmc/commit/5df2e57368cf5867f588d00a503eb624e5121460 + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + xbmc/utils/RegExp.cpp | 30 ------------------------------ + xbmc/utils/RegExp.h | 5 ----- + xbmc/utils/test/TestRegExp.cpp | 17 ----------------- + 3 files changed, 52 deletions(-) + +diff --git a/xbmc/utils/RegExp.cpp b/xbmc/utils/RegExp.cpp +index 9667b646a9..40263a28eb 100644 +--- a/xbmc/utils/RegExp.cpp ++++ b/xbmc/utils/RegExp.cpp +@@ -485,11 +485,6 @@ int CRegExp::GetSubStart(int iSub) const + return m_iOvector[iSub*2] + m_offset; + } + +-int CRegExp::GetSubStart(const std::string& subName) const +-{ +- return GetSubStart(GetNamedSubPatternNumber(subName.c_str())); +-} +- + int CRegExp::GetSubLength(int iSub) const + { + if (!IsValidSubNumber(iSub)) +@@ -498,11 +493,6 @@ int CRegExp::GetSubLength(int iSub) const + return m_iOvector[(iSub*2)+1] - m_iOvector[(iSub*2)]; + } + +-int CRegExp::GetSubLength(const std::string& subName) const +-{ +- return GetSubLength(GetNamedSubPatternNumber(subName.c_str())); +-} +- + std::string CRegExp::GetMatch(int iSub /* = 0 */) const + { + if (!IsValidSubNumber(iSub)) +@@ -516,26 +506,6 @@ std::string CRegExp::GetMatch(int iSub /* = 0 */) const + return m_subject.substr(pos, len); + } + +-std::string CRegExp::GetMatch(const std::string& subName) const +-{ +- return GetMatch(GetNamedSubPatternNumber(subName.c_str())); +-} +- +-bool CRegExp::GetNamedSubPattern(const char* strName, std::string& strMatch) const +-{ +- strMatch.clear(); +- int iSub = pcre_get_stringnumber(m_re, strName); +- if (!IsValidSubNumber(iSub)) +- return false; +- strMatch = GetMatch(iSub); +- return true; +-} +- +-int CRegExp::GetNamedSubPatternNumber(const char* strName) const +-{ +- return pcre_get_stringnumber(m_re, strName); +-} +- + void CRegExp::DumpOvector(int iLog /* = LOGDEBUG */) + { + if (iLog < LOGDEBUG || iLog > LOGNONE) +diff --git a/xbmc/utils/RegExp.h b/xbmc/utils/RegExp.h +index 53f6019a8f..feea89cd0d 100644 +--- a/xbmc/utils/RegExp.h ++++ b/xbmc/utils/RegExp.h +@@ -111,15 +111,10 @@ public: + }; + int GetSubCount() const { return m_iMatchCount - 1; } // PCRE returns the number of sub-patterns + 1 + int GetSubStart(int iSub) const; +- int GetSubStart(const std::string& subName) const; + int GetSubLength(int iSub) const; +- int GetSubLength(const std::string& subName) const; + int GetCaptureTotal() const; + std::string GetMatch(int iSub = 0) const; +- std::string GetMatch(const std::string& subName) const; + const std::string& GetPattern() const { return m_pattern; } +- bool GetNamedSubPattern(const char* strName, std::string& strMatch) const; +- int GetNamedSubPatternNumber(const char* strName) const; + void DumpOvector(int iLog); + /** + * Check is RegExp object is ready for matching +diff --git a/xbmc/utils/test/TestRegExp.cpp b/xbmc/utils/test/TestRegExp.cpp +index d757127417..9435a46aa4 100644 +--- a/xbmc/utils/test/TestRegExp.cpp ++++ b/xbmc/utils/test/TestRegExp.cpp +@@ -96,19 +96,6 @@ TEST(TestRegExp, GetPattern) + EXPECT_STREQ("^(Test)\\s*(.*)\\.", regex.GetPattern().c_str()); + } + +-TEST(TestRegExp, GetNamedSubPattern) +-{ +- CRegExp regex; +- std::string match; +- +- EXPECT_TRUE(regex.RegComp("^(?<first>Test)\\s*(?<second>.*)\\.")); +- EXPECT_EQ(0, regex.RegFind("Test string.")); +- EXPECT_TRUE(regex.GetNamedSubPattern("first", match)); +- EXPECT_STREQ("Test", match.c_str()); +- EXPECT_TRUE(regex.GetNamedSubPattern("second", match)); +- EXPECT_STREQ("string", match.c_str()); +-} +- + TEST(TestRegExp, operatorEqual) + { + CRegExp regex, regexcopy; +@@ -117,10 +104,6 @@ TEST(TestRegExp, operatorEqual) + EXPECT_TRUE(regex.RegComp("^(?<first>Test)\\s*(?<second>.*)\\.")); + regexcopy = regex; + EXPECT_EQ(0, regexcopy.RegFind("Test string.")); +- EXPECT_TRUE(regexcopy.GetNamedSubPattern("first", match)); +- EXPECT_STREQ("Test", match.c_str()); +- EXPECT_TRUE(regexcopy.GetNamedSubPattern("second", match)); +- EXPECT_STREQ("string", match.c_str()); + } + + class TestRegExpLog : public testing::Test +-- +2.47.3 +
package/kodi/0004-Introduce-PCRE2-dependency.patch new file +192 -0
192 lines not on this page · raw message
package/kodi/0005-Migrate-PCRE-to-PCRE2-and-remove-PCRE.patch new file +486 -0
486 lines not on this page · raw message
package/kodi/Config.in +1 -2
@@ -91,8 +91,7 @@ menuconfig BR2_PACKAGE_KODI select BR2_PACKAGE_LIBPNG select BR2_PACKAGE_LZO select BR2_PACKAGE_OPENSSL - select BR2_PACKAGE_PCRE - select BR2_PACKAGE_PCRE_UCP + select BR2_PACKAGE_PCRE2 select BR2_PACKAGE_PYTHON3_2TO3 select BR2_PACKAGE_PYTHON3_PYEXPAT select BR2_PACKAGE_PYTHON3_SQLITE
package/kodi/kodi.mk +1 -1
@@ -47,7 +47,7 @@ KODI_DEPENDENCIES = \ libpng \ lzo \ openssl \ - pcre \ + pcre2 \ python3 \ rapidjson \ spdlog \
Signature · 6 lines
2.47.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot