Projects
openEuler:24.03:SP1:Everything
pcre2
Sign Up
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 5
View file
_service:tar_scm:pcre2.spec
Changed
@@ -1,6 +1,6 @@ Name: pcre2 Version: 10.42 -Release: 9 +Release: 10 Summary: Perl Compatible Regular Expressions License: BSD URL: http://www.pcre.org/ @@ -31,6 +31,8 @@ Patch6020: backport-Fixing-an-issue-using-empty-character-sets-in-jit.patch Patch6021: backport-pcre2grep-document-better-possible-multiline-matchin.patch Patch6022: backport-Remove-incorrect-optimization-in-DFA-matching-when-p.patch +Patch6023: backport-Implement-PCRE2_EXTRA_CASELESS_RESTRICT-and-related-.patch +Patch6024: backport-Additional-PCRE2_EXTRA_ASCII_xxx-code.patch BuildRequires: autoconf libtool automake coreutils gcc make readline-devel Obsoletes: pcre2-utf16 pcre2-utf32 pcre2-tools @@ -148,6 +150,9 @@ %{_pkgdocdir}/html/ %changelog +* Thu Oct 31 2024 xujing <xujing125@huawei.com> - 10.42-10 +- DESC:sync patches to fix grep testcase failed + * Tue Sep 03 2024 dongyuzhen <dongyuzhen@h-partners.com> - 10.42-9 - DESC:Remove incorrect optimization in DFA matching when partial matching and (*F) are involved
View file
_service:tar_scm:backport-Additional-PCRE2_EXTRA_ASCII_xxx-code.patch
Added
@@ -0,0 +1,1489 @@ +From a6089462a460a9f6c2db63a86e1c09fabaa81499 Mon Sep 17 00:00:00 2001 +From: Philip Hazel <Philip.Hazel@gmail.com> +Date: Wed, 1 Feb 2023 17:42:29 +0000 +Subject: PATCH Additional PCRE2_EXTRA_ASCII_xxx code + +Conflict:NA +Reference:https://github.com/PCRE2Project/pcre2/commit/a6089462a460a9f6c2db63a86e1c09fabaa81499 + +--- + src/pcre2.h.in | 4 + + src/pcre2_compile.c | 375 ++++++++++++++++++++++++++----------------- + src/pcre2test.c | 21 ++- + testdata/testinput5 | 133 +++++++++++++++ + testdata/testinput7 | 133 +++++++++++++++ + testdata/testoutput5 | 179 +++++++++++++++++++++ + testdata/testoutput7 | 179 +++++++++++++++++++++ + 7 files changed, 869 insertions(+), 155 deletions(-) + +diff --git a/src/pcre2.h.in b/src/pcre2.h.in +index 11419a38..7202c633 100644 +--- a/src/pcre2.h.in ++++ b/src/pcre2.h.in +@@ -154,6 +154,10 @@ D is inspected during pcre2_dfa_match() execution + #define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */ + #define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */ + #define PCRE2_EXTRA_CASELESS_RESTRICT 0x00000080u /* C */ ++#define PCRE2_EXTRA_ASCII_BSD 0x00000100u /* C */ ++#define PCRE2_EXTRA_ASCII_BSS 0x00000200u /* C */ ++#define PCRE2_EXTRA_ASCII_BSW 0x00000400u /* C */ ++#define PCRE2_EXTRA_ASCII_POSIX 0x00000800u /* C */ + + /* These are for pcre2_jit_compile(). */ + +diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c +index ed2fe8a7..b8a9e098 100644 +--- a/src/pcre2_compile.c ++++ b/src/pcre2_compile.c +@@ -123,7 +123,7 @@ static unsigned int + #endif + + static int +- compile_regex(uint32_t, uint32_t, PCRE2_UCHAR **, uint32_t **, int *, ++ compile_regex(uint32_t, uint32_t, PCRE2_UCHAR **, uint32_t **, int *, + uint32_t, uint32_t *, uint32_t *, uint32_t *, uint32_t *, branch_chain *, + compile_block *, PCRE2_SIZE *); + +@@ -694,8 +694,8 @@ static uint32_t chartypeoffset = { + now all in a single string, to reduce the number of relocations when a shared + library is dynamically loaded. The list of lengths is terminated by a zero + length entry. The first three must be alpha, lower, upper, as this is assumed +-for handling case independence. The indices for graph, print, and punct are +-needed, so identify them. */ ++for handling case independence. The indices for several classes are needed, so ++identify them. */ + + static const char posix_names = + STRING_alpha0 STRING_lower0 STRING_upper0 STRING_alnum0 +@@ -785,7 +785,8 @@ are allowed. */ + (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \ + PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES|PCRE2_EXTRA_BAD_ESCAPE_IS_LITERAL| \ + PCRE2_EXTRA_ESCAPED_CR_IS_LF|PCRE2_EXTRA_ALT_BSUX| \ +- PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK) ++ PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK|PCRE2_EXTRA_ASCII_BSD| \ ++ PCRE2_EXTRA_ASCII_BSS|PCRE2_EXTRA_ASCII_BSW|PCRE2_EXTRA_ASCII_POSIX) + + /* Compile time error code numbers. They are given names so that they can more + easily be tracked. When a new number is added, the tables called eint1 and +@@ -1059,9 +1060,9 @@ for (;;) + case META_SKIP: fprintf(stderr, "META (*SKIP)"); break; + case META_THEN: fprintf(stderr, "META (*THEN)"); break; + +- case META_OPTIONS: +- fprintf(stderr, "META_OPTIONS 0x%08x 0x%08x", pptr0, pptr1); +- pptr += 2; ++ case META_OPTIONS: ++ fprintf(stderr, "META_OPTIONS 0x%08x 0x%08x", pptr0, pptr1); ++ pptr += 2; + break; + + case META_LOOKBEHIND: +@@ -1494,7 +1495,7 @@ Arguments: + chptr points to a returned data character + errorcodeptr points to the errorcode variable (containing zero) + options the current options bits +- xoptions the current extra options bits ++ xoptions the current extra options bits + isclass TRUE if inside a character class + cb compile data block or NULL when called from pcre2_substitute() + +@@ -2536,6 +2537,85 @@ return parsed_pattern; + + + ++/************************************************* ++* Handle \d, \D, \s, \S, \w, \W * ++*************************************************/ ++ ++/* This function is called from parse_regex() below, both for freestanding ++escapes, and those within classes, to handle those escapes that may change when ++Unicode property support is requested. Note that PCRE2_UCP will never be set ++without Unicode support because that is checked when pcre2_compile() is called. ++ ++Arguments: ++ escape the ESC_... value ++ parsed_pattern where to add the code ++ options options bits ++ xoptions extra options bits ++ ++Returns: updated value of parsed_pattern ++*/ ++static uint32_t * ++handle_escdsw(int escape, uint32_t *parsed_pattern, uint32_t options, ++ uint32_t xoptions) ++{ ++uint32_t ascii_option = 0; ++uint32_t prop = ESC_p; ++ ++switch(escape) ++ { ++ case ESC_D: ++ prop = ESC_P; ++ /* Fall through */ ++ case ESC_d: ++ ascii_option = PCRE2_EXTRA_ASCII_BSD; ++ break; ++ ++ case ESC_S: ++ prop = ESC_P; ++ /* Fall through */ ++ case ESC_s: ++ ascii_option = PCRE2_EXTRA_ASCII_BSS; ++ break; ++ ++ case ESC_W: ++ prop = ESC_P; ++ /* Fall through */ ++ case ESC_w: ++ ascii_option = PCRE2_EXTRA_ASCII_BSW; ++ break; ++ } ++ ++if ((options & PCRE2_UCP) == 0 || (xoptions & ascii_option) != 0) ++ { ++ *parsed_pattern++ = META_ESCAPE + escape; ++ } ++else ++ { ++ *parsed_pattern++ = META_ESCAPE + prop; ++ switch(escape) ++ { ++ case ESC_d: ++ case ESC_D: ++ *parsed_pattern++ = (PT_PC << 16) | ucp_Nd; ++ break; ++ ++ case ESC_s: ++ case ESC_S: ++ *parsed_pattern++ = PT_SPACE << 16; ++ break; ++ ++ case ESC_w: ++ case ESC_W: ++ *parsed_pattern++ = PT_WORD << 16; ++ break; ++ } ++ } ++ ++return parsed_pattern; ++} ++ ++ ++ + /************************************************* + * Parse regex and identify named groups * + *************************************************/ +@@ -2564,7 +2644,7 @@ typedef struct nest_save { + uint16_t max_group; + uint16_t flags; + uint32_t options; +- uint32_t xoptions; ++ uint32_t xoptions; + } nest_save; + + #define NSF_RESET 0x0001u +@@ -2579,8 +2659,11 @@ the main compiling phase. */ + #define PARSE_TRACKED_OPTIONS (PCRE2_CASELESS|PCRE2_DOTALL|PCRE2_DUPNAMES| \ + PCRE2_EXTENDED|PCRE2_EXTENDED_MORE|PCRE2_MULTILINE|PCRE2_NO_AUTO_CAPTURE| \ + PCRE2_UNGREEDY) +- +-#define PARSE_TRACKED_EXTRA_OPTIONS (PCRE2_EXTRA_CASELESS_RESTRICT) ++ ++#define PARSE_TRACKED_EXTRA_OPTIONS (PCRE2_EXTRA_CASELESS_RESTRICT) ++ ++#define PARSE_TRACKED_EXTRA_OPTIONS (PCRE2_EXTRA_CASELESS_RESTRICT| \ ++ PCRE2_EXTRA_ASCII_BSD|PCRE2_EXTRA_ASCII_BSS|PCRE2_EXTRA_ASCII_BSW) + + /* States used for analyzing ranges in character classes. The two OK values + must be last. */ +@@ -3115,9 +3198,7 @@ while (ptr < ptrend)
View file
_service:tar_scm:backport-Implement-PCRE2_EXTRA_CASELESS_RESTRICT-and-related-.patch
Added
@@ -0,0 +1,1649 @@ +From 9a4fd79230cf583153bec4b4749a1864a55c89fb Mon Sep 17 00:00:00 2001 +From: Philip Hazel <Philip.Hazel@gmail.com> +Date: Sun, 29 Jan 2023 16:46:24 +0000 +Subject: PATCH Implement PCRE2_EXTRA_CASELESS_RESTRICT and related features + +Conflict:don't modify ChangeLog; don't modify maint/* because files don't +exist; adapt context; +Reference:https://github.com/PCRE2Project/pcre2/commit/c13d54f6581fa51a270a1ec40b1b7626d686dec1 + +--- + HACKING | 10 +- + src/pcre2.h.in | 3 +- + src/pcre2_compile.c | 259 ++++++++++++++++++++++++-------------- + src/pcre2_ucd.c | 6 +- + src/pcre2test.c | 21 ++-- + testdata/testinput5 | 97 ++++++++++++++ + testdata/testinput7 | 97 ++++++++++++++ + testdata/testoutput5 | 180 ++++++++++++++++++++++++++ + testdata/testoutput7 | 180 ++++++++++++++++++++++++++ + testdata/testoutput8-16-2 | 2 +- + testdata/testoutput8-8-2 | 2 +- + 11 files changed, 742 insertions(+), 115 deletions(-) + +diff --git a/HACKING b/HACKING +index 2f194db..88ebad5 100644 +--- a/HACKING ++++ b/HACKING +@@ -1,4 +1,4 @@ +-Technical Notes about PCRE2 ++Technical notes about PCRE2 + --------------------------- + + These are very rough technical notes that record potentially useful information +@@ -248,7 +248,6 @@ by a length and an offset into the pattern to specify the name. + The following have one data item that follows in the next vector element: + + META_BIGVALUE Next is a literal >= META_END +-META_OPTIONS (?i) and friends (data is new option bits) + META_POSIX POSIX class item (data identifies the class) + META_POSIX_NEG negative POSIX class item (ditto) + +@@ -298,6 +297,11 @@ META_MINMAX {n,m} repeat + META_MINMAX_PLUS {n,m}+ repeat + META_MINMAX_QUERY {n,m}? repeat + ++This one is followed by two elements, giving the new option settings for the ++main and extra options, respectively. ++ ++META_OPTIONS (?i) and friends ++ + This one is followed by three elements. The first is 0 for '>' and 1 for '>='; + the next two are the major and minor numbers: + +@@ -827,4 +831,4 @@ not a real opcode, but is used to check at compile time that tables indexed by + opcode are the correct length, in order to catch updating errors. + + Philip Hazel +-April 2022 ++January 2023 +diff --git a/src/pcre2.h.in b/src/pcre2.h.in +index 7b8818d..60c2905 100644 +--- a/src/pcre2.h.in ++++ b/src/pcre2.h.in +@@ -5,7 +5,7 @@ + /* This is the public header file for the PCRE library, second API, to be + #included by applications that call PCRE2 functions. + +- Copyright (c) 2016-2021 University of Cambridge ++ Copyright (c) 2016-2023 University of Cambridge + + ----------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without +@@ -153,6 +153,7 @@ D is inspected during pcre2_dfa_match() execution + #define PCRE2_EXTRA_ESCAPED_CR_IS_LF 0x00000010u /* C */ + #define PCRE2_EXTRA_ALT_BSUX 0x00000020u /* C */ + #define PCRE2_EXTRA_ALLOW_LOOKAROUND_BSK 0x00000040u /* C */ ++#define PCRE2_EXTRA_CASELESS_RESTRICT 0x00000080u /* C */ + + /* These are for pcre2_jit_compile(). */ + +diff --git a/src/pcre2_compile.c b/src/pcre2_compile.c +index 99ffd29..464c9db 100644 +--- a/src/pcre2_compile.c ++++ b/src/pcre2_compile.c +@@ -7,7 +7,7 @@ and semantics are as close as possible to those of the Perl 5 language. + + Written by Philip Hazel + Original API code Copyright (c) 1997-2012 University of Cambridge +- New API code Copyright (c) 2016-2022 University of Cambridge ++ New API code Copyright (c) 2016-2023 University of Cambridge + + ----------------------------------------------------------------------------- + Redistribution and use in source and binary forms, with or without +@@ -118,13 +118,13 @@ them will be able to (i.e. assume a 64-bit world). */ + + #ifdef SUPPORT_UNICODE + static unsigned int +- add_list_to_class_internal(uint8_t *, PCRE2_UCHAR **, uint32_t, ++ add_list_to_class_internal(uint8_t *, PCRE2_UCHAR **, uint32_t, uint32_t, + compile_block *, const uint32_t *, unsigned int); + #endif + + static int +- compile_regex(uint32_t, PCRE2_UCHAR **, uint32_t **, int *, uint32_t, +- uint32_t *, uint32_t *, uint32_t *, uint32_t *, branch_chain *, ++ compile_regex(uint32_t, uint32_t, PCRE2_UCHAR **, uint32_t **, int *, ++ uint32_t, uint32_t *, uint32_t *, uint32_t *, uint32_t *, branch_chain *, + compile_block *, PCRE2_SIZE *); + + static int +@@ -779,7 +779,7 @@ are allowed. */ + PCRE2_NO_DOTSTAR_ANCHOR|PCRE2_UCP|PCRE2_UNGREEDY) + + #define PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS \ +- (PCRE2_EXTRA_MATCH_LINE|PCRE2_EXTRA_MATCH_WORD) ++ (PCRE2_EXTRA_MATCH_LINE|PCRE2_EXTRA_MATCH_WORD|PCRE2_EXTRA_CASELESS_RESTRICT) + + #define PUBLIC_COMPILE_EXTRA_OPTIONS \ + (PUBLIC_LITERAL_COMPILE_EXTRA_OPTIONS| \ +@@ -1059,7 +1059,10 @@ for (;;) + case META_SKIP: fprintf(stderr, "META (*SKIP)"); break; + case META_THEN: fprintf(stderr, "META (*THEN)"); break; + +- case META_OPTIONS: fprintf(stderr, "META_OPTIONS 0x%02x", *pptr++); break; ++ case META_OPTIONS: ++ fprintf(stderr, "META_OPTIONS 0x%08x 0x%08x", pptr0, pptr1); ++ pptr += 2; ++ break; + + case META_LOOKBEHIND: + fprintf(stderr, "META (?<= %d offset=", meta_arg); +@@ -1491,6 +1494,7 @@ Arguments: + chptr points to a returned data character + errorcodeptr points to the errorcode variable (containing zero) + options the current options bits ++ xoptions the current extra options bits + isclass TRUE if inside a character class + cb compile data block or NULL when called from pcre2_substitute() + +@@ -1502,7 +1506,7 @@ Returns: zero => a data character + + int + PRIV(check_escape)(PCRE2_SPTR *ptrptr, PCRE2_SPTR ptrend, uint32_t *chptr, +- int *errorcodeptr, uint32_t options, uint32_t extra_options, BOOL isclass, ++ int *errorcodeptr, uint32_t options, uint32_t xoptions, BOOL isclass, + compile_block *cb) + { + BOOL utf = (options & PCRE2_UTF) != 0; +@@ -1539,7 +1543,7 @@ else if ((i = escapesc - ESCAPES_FIRST) != 0) + if (i > 0) + { + c = (uint32_t)i; +- if (c == CHAR_CR && (extra_options & PCRE2_EXTRA_ESCAPED_CR_IS_LF) != 0) ++ if (c == CHAR_CR && (xoptions & PCRE2_EXTRA_ESCAPED_CR_IS_LF) != 0) + c = CHAR_LF; + } + else /* Negative table entry */ +@@ -1603,7 +1607,7 @@ else + PCRE2_SPTR oldptr; + BOOL overflow; + BOOL alt_bsux = +- ((options & PCRE2_ALT_BSUX) | (extra_options & PCRE2_EXTRA_ALT_BSUX)) != 0; ++ ((options & PCRE2_ALT_BSUX) | (xoptions & PCRE2_EXTRA_ALT_BSUX)) != 0; + + /* Filter calls from pcre2_substitute(). */ + +@@ -1641,7 +1645,7 @@ else + + if (ptr >= ptrend) break; + if (*ptr == CHAR_LEFT_CURLY_BRACKET && +- (extra_options & PCRE2_EXTRA_ALT_BSUX) != 0) ++ (xoptions & PCRE2_EXTRA_ALT_BSUX) != 0) + { + PCRE2_SPTR hptr = ptr + 1; + cc = 0; +@@ -1685,7 +1689,7 @@ else + if (c > 0x10ffffU) *errorcodeptr = ERR77; + else + if (c >= 0xd800 && c <= 0xdfff && +- (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) ++ (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) + *errorcodeptr = ERR73; + } + else if (c > MAX_NON_UTF_CHAR) *errorcodeptr = ERR77; +@@ -1880,7 +1884,7 @@ else + else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET) + { + if (utf && c >= 0xd800 && c <= 0xdfff && +- (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) ++ (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) + { + ptr--; + *errorcodeptr = ERR73; +@@ -1953,7 +1957,7 @@ else + else if (ptr < ptrend && *ptr++ == CHAR_RIGHT_CURLY_BRACKET) + { + if (utf && c >= 0xd800 && c <= 0xdfff && +- (extra_options & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0) ++ (xoptions & PCRE2_EXTRA_ALLOW_SURROGATE_ESCAPES) == 0)
View file
_service
Changed
@@ -2,7 +2,7 @@ <service name="tar_scm"> <param name="scm">git</param> <param name="url">git@gitee.com:src-openeuler/pcre2.git</param> - <param name="revision">openEuler-24.03-LTS-Next</param> + <param name="revision">openEuler-24.03-LTS-SP1</param> <param name="exclude">*</param> <param name="extract">*</param> </service>
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2