From b9ce472cfae6449357b18ca1bcb35fb9529aec7c Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 21 Dec 2017 09:35:06 +0100 Subject: [PATCH] eit: use 'pcre' defines as common - identify older pcre library as "pcre1" - use "pcre" json maps as common (shared for both pcre/pcre2 libraries) --- data/conf/epggrab/eit/scrape/uk | 5 ----- src/epggrab/module/eitpatternlist.c | 2 ++ src/tvhregex.h | 2 +- support/eitscrape_test.py | 5 ++++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/data/conf/epggrab/eit/scrape/uk b/data/conf/epggrab/eit/scrape/uk index b412318a6..d7286ba47 100644 --- a/data/conf/epggrab/eit/scrape/uk +++ b/data/conf/epggrab/eit/scrape/uk @@ -29,10 +29,5 @@ "scrape_subtitle": [ "^(?:[.][.][.][^:.]*[.:] +|[0-9]+/[0-9]+[.] +)?([^.0-9][^:]*): " ] - }, - "pcre2": { - "scrape_subtitle": [ - "^(?:[.][.][.][^:.]*[.:] +|[0-9]+/[0-9]+[.] +)?([^.0-9][^:]*): " - ] } } diff --git a/src/epggrab/module/eitpatternlist.c b/src/epggrab/module/eitpatternlist.c index 787072a1b..e066c1bb6 100644 --- a/src/epggrab/module/eitpatternlist.c +++ b/src/epggrab/module/eitpatternlist.c @@ -50,6 +50,8 @@ void eit_pattern_compile_named_list ( eit_pattern_list_t *list, htsmsg_t *m, con { #if defined(TVHREGEX_TYPE) htsmsg_t *m_alt = htsmsg_get_map(m, TVHREGEX_TYPE); + if (!m_alt) + m_alt = htsmsg_get_map(m, "pcre"); if (m_alt) { htsmsg_t *res = htsmsg_get_list(m_alt, key); if (res) { diff --git a/src/tvhregex.h b/src/tvhregex.h index 5c698eac3..b7b8ec1d3 100644 --- a/src/tvhregex.h +++ b/src/tvhregex.h @@ -26,7 +26,7 @@ # define PCRE_STUDY_JIT_COMPILE 0 # endif -#define TVHREGEX_TYPE "pcre" +#define TVHREGEX_TYPE "pcre1" #elif ENABLE_PCRE2 diff --git a/support/eitscrape_test.py b/support/eitscrape_test.py index 11ceb66cf..a38d0ef94 100755 --- a/support/eitscrape_test.py +++ b/support/eitscrape_test.py @@ -134,7 +134,10 @@ def main(argv): group = parser.add_mutually_exclusive_group() group.add_argument('--pcre', dest='engine', action='store_const', const='pcre', - help='test PCRE regular expressions if available') + help='test PCRE common regular expressions if available') + group.add_argument('--pcre1', dest='engine', + action='store_const', const='pcre1', + help='test PCRE1 regular expressions if available') group.add_argument('--pcre2', dest='engine', action='store_const', const='pcre2', help='test PCRE2 regular expressions if available') -- 2.47.3