fix FTBFS caused by texinfo 7.1
- fix build of the PCRE module
This commit is contained in:
parent
584e38d1fd
commit
47d6eba90a
@ -1,8 +1,9 @@
|
|||||||
From b62e911341c8ec7446378b477c47da4256053dc0 Mon Sep 17 00:00:00 2001
|
From b62e911341c8ec7446378b477c47da4256053dc0 Mon Sep 17 00:00:00 2001
|
||||||
From: Oliver Kiddle <opk@zsh.org>
|
From: Oliver Kiddle <opk@zsh.org>
|
||||||
Date: Sat, 13 May 2023 00:53:32 +0200
|
Date: Sat, 13 May 2023 00:53:32 +0200
|
||||||
Subject: [PATCH 1/3] 51723: migrate pcre module to pcre2
|
Subject: [PATCH] 51723: migrate pcre module to pcre2
|
||||||
|
|
||||||
|
Cherry-picked-by: Lukáš Zaoral <lzaoral@redhat.com>
|
||||||
---
|
---
|
||||||
Src/Modules/pcre.c | 223 ++++++++++++++++++---------------------------
|
Src/Modules/pcre.c | 223 ++++++++++++++++++---------------------------
|
||||||
Test/V07pcre.ztst | 13 ++-
|
Test/V07pcre.ztst | 13 ++-
|
||||||
@ -533,331 +534,108 @@ index d8a17791a..4710d1659 100644
|
|||||||
--
|
--
|
||||||
2.41.0
|
2.41.0
|
||||||
|
|
||||||
|
From 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||||
|
Date: Tue, 20 Jun 2023 18:14:27 +0900
|
||||||
|
Subject: [PATCH] 51877: do not build pcre module if pcre2-config is not found
|
||||||
|
|
||||||
From f3f371deb376478176866fd770fbcf9bc0d0609f Mon Sep 17 00:00:00 2001
|
Cherry-picked-by: Lukáš Zaoral <lzaoral@redhat.com>
|
||||||
From: Oliver Kiddle <opk@zsh.org>
|
|
||||||
Date: Sat, 13 May 2023 00:56:48 +0200
|
|
||||||
Subject: [PATCH 2/3] 51728: assign pcre named capture groups to a hash
|
|
||||||
|
|
||||||
---
|
---
|
||||||
Doc/Zsh/mod_pcre.yo | 10 ++++++----
|
Src/Modules/pcre.mdd | 2 +-
|
||||||
Src/Modules/pcre.c | 43 +++++++++++++++++++++++++++++++++----------
|
configure.ac | 31 +++++++++++++++++++------------
|
||||||
Test/V07pcre.ztst | 14 ++++++++++++++
|
2 files changed, 20 insertions(+), 13 deletions(-)
|
||||||
3 files changed, 53 insertions(+), 14 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Doc/Zsh/mod_pcre.yo b/Doc/Zsh/mod_pcre.yo
|
diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd
|
||||||
index c2817f519..6d073985d 100644
|
index 6eb3c691b..3e1579117 100644
|
||||||
--- a/Doc/Zsh/mod_pcre.yo
|
--- a/Src/Modules/pcre.mdd
|
||||||
+++ b/Doc/Zsh/mod_pcre.yo
|
+++ b/Src/Modules/pcre.mdd
|
||||||
@@ -20,12 +20,12 @@ including those that indicate newline.
|
@@ -1,5 +1,5 @@
|
||||||
)
|
name=zsh/pcre
|
||||||
findex(pcre_study)
|
-link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi`
|
||||||
item(tt(pcre_study))(
|
+link=`if test x$enable_pcre = xyes; then echo dynamic; else echo no; fi`
|
||||||
-Studies the previously-compiled PCRE which may result in faster
|
load=no
|
||||||
-matching.
|
|
||||||
+Requests JIT compilation for the previously-compiled PCRE which
|
|
||||||
+may result in faster matching.
|
|
||||||
)
|
|
||||||
findex(pcre_match)
|
|
||||||
item(tt(pcre_match) [ tt(-v) var(var) ] [ tt(-a) var(arr) ] \
|
|
||||||
-[ tt(-n) var(offset) ] [ tt(-b) ] var(string))(
|
|
||||||
+[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-b) ] var(string))(
|
|
||||||
Returns successfully if tt(string) matches the previously-compiled
|
|
||||||
PCRE.
|
|
||||||
|
|
||||||
@@ -36,7 +36,9 @@ substrings, unless the tt(-a) option is given, in which
|
autofeatures="b:pcre_compile b:pcre_study b:pcre_match"
|
||||||
case it will set the array var(arr). Similarly, the variable
|
diff --git a/configure.ac b/configure.ac
|
||||||
tt(MATCH) will be set to the entire matched portion of the
|
index ba76f9a60..c5263035e 100644
|
||||||
string, unless the tt(-v) option is given, in which case the variable
|
--- a/configure.ac
|
||||||
-var(var) will be set.
|
+++ b/configure.ac
|
||||||
+var(var) will be set. Furthermore, any named captures will
|
@@ -440,6 +440,17 @@ dnl Do you want to look for pcre support?
|
||||||
+be stored in the associative array tt(.pcre.match) unless an
|
AC_ARG_ENABLE(pcre,
|
||||||
+alternative is given with tt(-A).
|
AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)]))
|
||||||
No variables are altered if there is no successful match.
|
|
||||||
A tt(-n) option starts searching for a match from the
|
|
||||||
byte var(offset) position in var(string). If the tt(-b) option is given,
|
|
||||||
diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c
|
|
||||||
index 079ecc2c5..6be1f76e2 100644
|
|
||||||
--- a/Src/Modules/pcre.c
|
|
||||||
+++ b/Src/Modules/pcre.c
|
|
||||||
@@ -129,14 +129,17 @@ bin_pcre_study(char *nam, UNUSED(char **args), UNUSED(Options ops), UNUSED(int f
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
+AC_ARG_VAR(PCRE_CONFIG, [pathname of pcre2-config if it is not in PATH])
|
||||||
-zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count,
|
+if test "x$enable_pcre" = xyes; then
|
||||||
- char *matchvar, char *substravar, int want_offset_pair,
|
+ AC_CHECK_PROG([PCRE_CONFIG], pcre2-config, pcre2-config)
|
||||||
- int matchedinarr, int want_begin_end)
|
+ if test "x$PCRE_CONFIG" = x; then
|
||||||
+zpcre_get_substrings(pcre2_code *pat, char *arg, pcre2_match_data *mdata,
|
+ enable_pcre=no
|
||||||
+ int captured_count, char *matchvar, char *substravar, char *namedassoc,
|
+ AC_MSG_WARN([pcre2-config not found: pcre module is disabled.])
|
||||||
+ int want_offset_pair, int matchedinarr, int want_begin_end)
|
+ AC_MSG_NOTICE(
|
||||||
{
|
+ [Set PCRE_CONFIG to pathname of pcre2-config if it is not in PATH.])
|
||||||
PCRE2_SIZE *ovec;
|
+ fi
|
||||||
char *match_all, **matches;
|
+fi
|
||||||
char offset_all[50];
|
|
||||||
int capture_start = 1;
|
|
||||||
+ int vec_off;
|
|
||||||
+ PCRE2_SPTR ntable; /* table of named captures */
|
|
||||||
+ uint32_t ncount, nsize;
|
|
||||||
|
|
||||||
if (matchedinarr) {
|
|
||||||
/* bash-style ovec[0] entire-matched string in the array */
|
|
||||||
@@ -174,7 +177,7 @@ zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count,
|
|
||||||
if (substravar &&
|
|
||||||
(!want_begin_end || nelem)) {
|
|
||||||
char **x;
|
|
||||||
- int vec_off, i;
|
|
||||||
+ int i;
|
|
||||||
matches = x = (char **) zalloc(sizeof(char *) * (captured_count+1-capture_start));
|
|
||||||
for (i = capture_start; i < captured_count; i++) {
|
|
||||||
vec_off = 2*i;
|
|
||||||
@@ -184,6 +187,23 @@ zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count,
|
|
||||||
setaparam(substravar, matches);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ if (!pcre2_pattern_info(pat, PCRE2_INFO_NAMECOUNT, &ncount) && ncount
|
|
||||||
+ && !pcre2_pattern_info(pat, PCRE2_INFO_NAMEENTRYSIZE, &nsize)
|
|
||||||
+ && !pcre2_pattern_info(pat, PCRE2_INFO_NAMETABLE, &ntable))
|
|
||||||
+ {
|
|
||||||
+ char **hash, **hashptr;
|
|
||||||
+ uint32_t nidx;
|
|
||||||
+ hashptr = hash = (char **)zshcalloc((ncount+1)*2*sizeof(char *));
|
|
||||||
+ for (nidx = 0; nidx < ncount; nidx++) {
|
|
||||||
+ vec_off = (ntable[nsize * nidx] << 9) + 2 * ntable[nsize * nidx + 1];
|
|
||||||
+ /* would metafy the key but pcre limits characters in the name */
|
|
||||||
+ *hashptr++ = ztrdup((char *) ntable + nsize * nidx + 2);
|
|
||||||
+ *hashptr++ = metafy(arg + ovec[vec_off],
|
|
||||||
+ ovec[vec_off+1]-ovec[vec_off], META_DUP);
|
|
||||||
+ }
|
|
||||||
+ sethparam(namedassoc, hash);
|
|
||||||
+ }
|
|
||||||
+
|
+
|
||||||
if (want_begin_end) {
|
dnl Do you want to look for capability support?
|
||||||
/*
|
AC_ARG_ENABLE(cap,
|
||||||
* cond-infix rather than builtin; also not bash; so we set a bunch
|
AS_HELP_STRING([--enable-cap],[enable the search for POSIX capabilities (may require additional headers to be added by hand)]))
|
||||||
@@ -286,6 +306,7 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))
|
@@ -655,15 +666,12 @@ AC_HEADER_DIRENT
|
||||||
char *matched_portion = NULL;
|
AC_HEADER_STAT
|
||||||
char *plaintext = NULL;
|
AC_HEADER_SYS_WAIT
|
||||||
char *receptacle = NULL;
|
|
||||||
+ char *named = ".pcre.match";
|
|
||||||
int return_value = 1;
|
|
||||||
/* The subject length and offset start are both int values in pcre_exec */
|
|
||||||
int subject_len;
|
|
||||||
@@ -305,6 +326,9 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))
|
|
||||||
if(OPT_HASARG(ops,c='v')) {
|
|
||||||
matched_portion = OPT_ARG(ops,c);
|
|
||||||
}
|
|
||||||
+ if (OPT_HASARG(ops, c='A')) {
|
|
||||||
+ named = OPT_ARG(ops, c);
|
|
||||||
+ }
|
|
||||||
if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */
|
|
||||||
if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0)
|
|
||||||
return 1;
|
|
||||||
@@ -326,8 +350,8 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))
|
|
||||||
if (ret==0) return_value = 0;
|
|
||||||
else if (ret == PCRE2_ERROR_NOMATCH) /* no match */;
|
|
||||||
else if (ret>0) {
|
|
||||||
- zpcre_get_substrings(plaintext, pcre_mdata, ret, matched_portion, receptacle,
|
|
||||||
- want_offset_pair, 0, 0);
|
|
||||||
+ zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, matched_portion,
|
|
||||||
+ receptacle, named, want_offset_pair, 0, 0);
|
|
||||||
return_value = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
@@ -405,9 +429,8 @@ cond_pcre_match(char **a, int id)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (r>0) {
|
|
||||||
- zpcre_get_substrings(lhstr_plain, pcre_mdata, r, svar, avar, 0,
|
|
||||||
- isset(BASHREMATCH),
|
|
||||||
- !isset(BASHREMATCH));
|
|
||||||
+ zpcre_get_substrings(pcre_pat, lhstr_plain, pcre_mdata, r, svar, avar,
|
|
||||||
+ ".pcre.match", 0, isset(BASHREMATCH), !isset(BASHREMATCH));
|
|
||||||
return_value = 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -443,7 +466,7 @@ static struct conddef cotab[] = {
|
|
||||||
|
|
||||||
static struct builtin bintab[] = {
|
-oldcflags="$CFLAGS"
|
||||||
BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimxs", NULL),
|
-if test x$enable_pcre = xyes; then
|
||||||
- BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "a:v:n:b", NULL),
|
-AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config)
|
||||||
+ BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:b", NULL),
|
dnl pcre2-config --cflags may produce a -I output which needs to go into
|
||||||
BUILTIN("pcre_study", 0, bin_pcre_study, 0, 0, 0, NULL, NULL)
|
dnl CPPFLAGS else configure's preprocessor tests don't pick it up,
|
||||||
};
|
dnl producing a warning.
|
||||||
|
-if test "x$ac_cv_prog_PCRECONF" = xpcre2-config; then
|
||||||
|
- CPPFLAGS="$CPPFLAGS `pcre2-config --cflags`"
|
||||||
|
-fi
|
||||||
|
+if test "x$enable_pcre" = xyes; then
|
||||||
|
+ CPPFLAGS="`$PCRE_CONFIG --cflags` $CPPFLAGS"
|
||||||
|
+ AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])
|
||||||
|
fi
|
||||||
|
|
||||||
diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst
|
AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
|
||||||
index 6eb366964..027fea3aa 100644
|
@@ -675,7 +683,6 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \
|
||||||
--- a/Test/V07pcre.ztst
|
netinet/in_systm.h langinfo.h wchar.h stddef.h \
|
||||||
+++ b/Test/V07pcre.ztst
|
sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \
|
||||||
@@ -182,3 +182,17 @@
|
ncurses/ncurses.h)
|
||||||
[[ abc =~ 'a(d*)bc' ]] && print "$#MATCH; $#match; ${#match[1]}"
|
-AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])
|
||||||
0:empty capture
|
if test x$dynamic = xyes; then
|
||||||
>3; 1; 0
|
AC_CHECK_HEADERS(dlfcn.h)
|
||||||
|
AC_CHECK_HEADERS(dl.h)
|
||||||
|
@@ -952,10 +959,6 @@ if test "x$ac_found_iconv" = "xyes"; then
|
||||||
|
[Define as const if the declaration of iconv() needs const.])
|
||||||
|
fi
|
||||||
|
|
||||||
|
-if test x$enable_pcre = xyes; then
|
||||||
|
- LIBS="`$ac_cv_prog_PCRECONF --libs8` $LIBS"
|
||||||
|
-fi
|
||||||
|
-
|
||||||
|
dnl ---------------------
|
||||||
|
dnl CHECK TERMCAP LIBRARY
|
||||||
|
dnl ---------------------
|
||||||
|
@@ -1316,7 +1319,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \
|
||||||
|
pathconf sysconf \
|
||||||
|
tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \
|
||||||
|
getcchar setcchar waddwstr wget_wch win_wch use_default_colors \
|
||||||
|
- pcre2_compile_8 \
|
||||||
|
nl_langinfo \
|
||||||
|
erand48 open_memstream \
|
||||||
|
posix_openpt \
|
||||||
|
@@ -1371,6 +1373,11 @@ if test x$zsh_cv_func_realpath_accepts_null = xyes; then
|
||||||
|
AC_DEFINE(REALPATH_ACCEPTS_NULL)
|
||||||
|
fi
|
||||||
|
|
||||||
|
+if test x$enable_pcre = xyes; then
|
||||||
|
+ LIBS="`$PCRE_CONFIG --libs8` $LIBS"
|
||||||
|
+ AC_CHECK_FUNCS(pcre2_compile_8)
|
||||||
|
+fi
|
||||||
+
|
+
|
||||||
+ [[ category/name-12345 =~ '(?x)^
|
if test x$enable_cap = xyes; then
|
||||||
+ (?<category> [^/]* ) /
|
AC_CHECK_FUNCS(cap_get_proc)
|
||||||
+ (?<package>
|
fi
|
||||||
+ (?<name> \w+ ) -
|
|
||||||
+ (?<version> \d+ ))$' ]]
|
|
||||||
+ typeset -p1 .pcre.match
|
|
||||||
+0:named captures
|
|
||||||
+>typeset -g -A .pcre.match=(
|
|
||||||
+> [category]=category
|
|
||||||
+> [name]=name
|
|
||||||
+> [package]=name-12345
|
|
||||||
+> [version]=12345
|
|
||||||
+>)
|
|
||||||
--
|
--
|
||||||
2.41.0
|
2.42.0
|
||||||
|
|
||||||
|
|
||||||
From b4d1c756f50909b4a13e5c8fe5f26f71e9d54f63 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Oliver Kiddle <opk@zsh.org>
|
|
||||||
Date: Sat, 13 May 2023 00:59:00 +0200
|
|
||||||
Subject: [PATCH 3/3] 51738: support pcre's alternative DFA matching algorithm
|
|
||||||
|
|
||||||
---
|
|
||||||
Doc/Zsh/mod_pcre.yo | 6 ++++-
|
|
||||||
Src/Modules/pcre.c | 53 ++++++++++++++++++++++++++++++---------------
|
|
||||||
Test/V07pcre.ztst | 5 +++++
|
|
||||||
3 files changed, 46 insertions(+), 18 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/Doc/Zsh/mod_pcre.yo b/Doc/Zsh/mod_pcre.yo
|
|
||||||
index 6d073985d..da73ac85a 100644
|
|
||||||
--- a/Doc/Zsh/mod_pcre.yo
|
|
||||||
+++ b/Doc/Zsh/mod_pcre.yo
|
|
||||||
@@ -25,7 +25,7 @@ may result in faster matching.
|
|
||||||
)
|
|
||||||
findex(pcre_match)
|
|
||||||
item(tt(pcre_match) [ tt(-v) var(var) ] [ tt(-a) var(arr) ] \
|
|
||||||
-[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-b) ] var(string))(
|
|
||||||
+[ tt(-A) var(assoc) ] [ tt(-n) var(offset) ] [ tt(-bd) ] var(string))(
|
|
||||||
Returns successfully if tt(string) matches the previously-compiled
|
|
||||||
PCRE.
|
|
||||||
|
|
||||||
@@ -69,6 +69,10 @@ print -l $accum)
|
|
||||||
)
|
|
||||||
enditem()
|
|
||||||
|
|
||||||
+The option tt(-d) uses the alternative breadth-first DFA search algorithm of
|
|
||||||
+pcre. This sets tt(match), or the array given with tt(-a), to all the matches
|
|
||||||
+found from the same start point in the subject.
|
|
||||||
+
|
|
||||||
The tt(zsh/pcre) module makes available the following test condition:
|
|
||||||
|
|
||||||
startitem()
|
|
||||||
diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c
|
|
||||||
index 6be1f76e2..96f3c6e65 100644
|
|
||||||
--- a/Src/Modules/pcre.c
|
|
||||||
+++ b/Src/Modules/pcre.c
|
|
||||||
@@ -305,30 +305,29 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))
|
|
||||||
pcre2_match_data *pcre_mdata = NULL;
|
|
||||||
char *matched_portion = NULL;
|
|
||||||
char *plaintext = NULL;
|
|
||||||
- char *receptacle = NULL;
|
|
||||||
- char *named = ".pcre.match";
|
|
||||||
+ char *receptacle;
|
|
||||||
+ char *named = NULL;
|
|
||||||
int return_value = 1;
|
|
||||||
/* The subject length and offset start are both int values in pcre_exec */
|
|
||||||
int subject_len;
|
|
||||||
int offset_start = 0;
|
|
||||||
int want_offset_pair = 0;
|
|
||||||
+ int use_dfa = 0;
|
|
||||||
|
|
||||||
if (pcre_pattern == NULL) {
|
|
||||||
zwarnnam(nam, "no pattern has been compiled");
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
- matched_portion = "MATCH";
|
|
||||||
- receptacle = "match";
|
|
||||||
- if(OPT_HASARG(ops,c='a')) {
|
|
||||||
- receptacle = OPT_ARG(ops,c);
|
|
||||||
- }
|
|
||||||
- if(OPT_HASARG(ops,c='v')) {
|
|
||||||
- matched_portion = OPT_ARG(ops,c);
|
|
||||||
- }
|
|
||||||
- if (OPT_HASARG(ops, c='A')) {
|
|
||||||
- named = OPT_ARG(ops, c);
|
|
||||||
+ if (!(use_dfa = OPT_ISSET(ops, 'd'))) {
|
|
||||||
+ matched_portion = OPT_HASARG(ops, c='v') ? OPT_ARG(ops, c) : "MATCH";
|
|
||||||
+ named = OPT_HASARG(ops, c='A') ? OPT_ARG(ops, c) : ".pcre.match";
|
|
||||||
+ } else if (OPT_HASARG(ops, c='v') || OPT_HASARG(ops, c='A')) {
|
|
||||||
+ zwarnnam(nam, "-d cannot be combined with -%c", c);
|
|
||||||
+ return 1;
|
|
||||||
}
|
|
||||||
+ receptacle = OPT_HASARG(ops, 'a') ? OPT_ARG(ops, 'a') : "match";
|
|
||||||
+
|
|
||||||
if(OPT_HASARG(ops,c='n')) { /* The offset position to start the search, in bytes. */
|
|
||||||
if ((offset_start = getposint(OPT_ARG(ops,c), nam)) < 0)
|
|
||||||
return 1;
|
|
||||||
@@ -341,7 +340,25 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))
|
|
||||||
|
|
||||||
if (offset_start > 0 && offset_start >= subject_len)
|
|
||||||
ret = PCRE2_ERROR_NOMATCH;
|
|
||||||
- else {
|
|
||||||
+ else if (use_dfa) {
|
|
||||||
+ PCRE2_SIZE old, wscount = 128, capcount = 128;
|
|
||||||
+ void *workspace = zhalloc(sizeof(int) * wscount);
|
|
||||||
+ pcre_mdata = pcre2_match_data_create(capcount, NULL);
|
|
||||||
+ do {
|
|
||||||
+ ret = pcre2_dfa_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len,
|
|
||||||
+ offset_start, 0, pcre_mdata, NULL, (int *) workspace, wscount);
|
|
||||||
+ if (ret == PCRE2_ERROR_DFA_WSSIZE) {
|
|
||||||
+ old = wscount;
|
|
||||||
+ wscount += wscount / 2;
|
|
||||||
+ workspace = hrealloc(workspace, sizeof(int) * old, sizeof(int) * wscount);
|
|
||||||
+ } else if (ret == 0) {
|
|
||||||
+ capcount += capcount / 2;
|
|
||||||
+ pcre2_match_data_free(pcre_mdata);
|
|
||||||
+ pcre_mdata = pcre2_match_data_create(capcount, NULL);
|
|
||||||
+ } else
|
|
||||||
+ break;
|
|
||||||
+ } while(1);
|
|
||||||
+ } else {
|
|
||||||
pcre_mdata = pcre2_match_data_create_from_pattern(pcre_pattern, NULL);
|
|
||||||
ret = pcre2_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len,
|
|
||||||
offset_start, 0, pcre_mdata, NULL);
|
|
||||||
@@ -350,12 +367,14 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))
|
|
||||||
if (ret==0) return_value = 0;
|
|
||||||
else if (ret == PCRE2_ERROR_NOMATCH) /* no match */;
|
|
||||||
else if (ret>0) {
|
|
||||||
- zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret, matched_portion,
|
|
||||||
- receptacle, named, want_offset_pair, 0, 0);
|
|
||||||
+ zpcre_get_substrings(pcre_pattern, plaintext, pcre_mdata, ret,
|
|
||||||
+ matched_portion, receptacle, named, want_offset_pair, use_dfa, 0);
|
|
||||||
return_value = 0;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
- zwarnnam(nam, "error in pcre2_match [%d]", ret);
|
|
||||||
+ PCRE2_UCHAR buffer[256];
|
|
||||||
+ pcre2_get_error_message(ret, buffer, sizeof(buffer));
|
|
||||||
+ zwarnnam(nam, "error in pcre matching for /%s/: %s", plaintext, buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pcre_mdata)
|
|
||||||
@@ -466,7 +485,7 @@ static struct conddef cotab[] = {
|
|
||||||
|
|
||||||
static struct builtin bintab[] = {
|
|
||||||
BUILTIN("pcre_compile", 0, bin_pcre_compile, 1, 1, 0, "aimxs", NULL),
|
|
||||||
- BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:b", NULL),
|
|
||||||
+ BUILTIN("pcre_match", 0, bin_pcre_match, 1, 1, 0, "A:a:v:n:bd", NULL),
|
|
||||||
BUILTIN("pcre_study", 0, bin_pcre_study, 0, 0, 0, NULL, NULL)
|
|
||||||
};
|
|
||||||
|
|
||||||
diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst
|
|
||||||
index 027fea3aa..585698d05 100644
|
|
||||||
--- a/Test/V07pcre.ztst
|
|
||||||
+++ b/Test/V07pcre.ztst
|
|
||||||
@@ -196,3 +196,8 @@
|
|
||||||
> [package]=name-12345
|
|
||||||
> [version]=12345
|
|
||||||
>)
|
|
||||||
+
|
|
||||||
+ pcre_compile 'cat(er(pillar)?)?'
|
|
||||||
+ pcre_match -d 'the caterpillar catchment' && print $match
|
|
||||||
+0:pcre_match -d
|
|
||||||
+>caterpillar cater cat
|
|
||||||
--
|
|
||||||
2.41.0
|
|
||||||
|
|
||||||
|
53
0006-zsh-support-texinfo-7.0.patch
Normal file
53
0006-zsh-support-texinfo-7.0.patch
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
From ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>
|
||||||
|
Date: Mon, 19 Jun 2023 11:19:25 +0900
|
||||||
|
Subject: [PATCH] 51862: support texinfo-7.0
|
||||||
|
|
||||||
|
Upstream-commit: ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4
|
||||||
|
Cherry-picked-by: Lukáš Zaoral <lzaoral@redhat.com>
|
||||||
|
---
|
||||||
|
Doc/Makefile.in | 3 ++-
|
||||||
|
configure.ac | 5 +++++
|
||||||
|
2 files changed, 7 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/Doc/Makefile.in b/Doc/Makefile.in
|
||||||
|
index 136b080d6..dabe11fe3 100644
|
||||||
|
--- a/Doc/Makefile.in
|
||||||
|
+++ b/Doc/Makefile.in
|
||||||
|
@@ -43,6 +43,7 @@ TEXI2DVI = @TEXI2DVI@
|
||||||
|
DVIPS = dvips
|
||||||
|
TEXI2PDF = @TEXI2PDF@
|
||||||
|
TEXI2HTML = @TEXI2HTML@
|
||||||
|
+SET_TEXI2ANY_VAR = @SET_TEXI2ANY_VAR@
|
||||||
|
PAPERSIZE = @PAPERSIZE@
|
||||||
|
|
||||||
|
.SUFFIXES: .yo .1
|
||||||
|
@@ -266,7 +267,7 @@ texi2html.conf: $(sdir_top)/Config/version.mk
|
||||||
|
d=`echo $(VERSION_DATE)`; \
|
||||||
|
v="<font size=\"-1\">Zsh version $(VERSION), released on $$d.</font>"; \
|
||||||
|
case '$(TEXI2HTML)' in \
|
||||||
|
- *texi2any*) echo "set_from_init_file('PRE_BODY_CLOSE','$$v');" ;; \
|
||||||
|
+ *texi2any*) echo "$(SET_TEXI2ANY_VAR)('PRE_BODY_CLOSE','$$v');" ;; \
|
||||||
|
*) echo "\$$PRE_BODY_CLOSE = '$$v';" ;; \
|
||||||
|
esac > $@
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 4710d1659..ba76f9a60 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -623,7 +623,12 @@ fi
|
||||||
|
|
||||||
|
if test x"$TEXI2HTML" = xtexi2any; then
|
||||||
|
TEXI2HTML='texi2any -c TEXI2HTML=1'
|
||||||
|
+ case `texi2any --version 2>/dev/null | sed -e 's/^.*) *//' -e 1q` in
|
||||||
|
+ [[1-6]].*) SET_TEXI2ANY_VAR=set_from_init_file ;;
|
||||||
|
+ *) SET_TEXI2ANY_VAR=texinfo_set_from_init_file ;;
|
||||||
|
+ esac
|
||||||
|
fi
|
||||||
|
+AC_SUBST(SET_TEXI2ANY_VAR)
|
||||||
|
|
||||||
|
case "$LC_PAPER" in
|
||||||
|
??_US*) PAPERSIZE=us ;;
|
||||||
|
--
|
||||||
|
2.42.0
|
||||||
|
|
12
zsh.spec
12
zsh.spec
@ -1,7 +1,7 @@
|
|||||||
Summary: Powerful interactive shell
|
Summary: Powerful interactive shell
|
||||||
Name: zsh
|
Name: zsh
|
||||||
Version: 5.9
|
Version: 5.9
|
||||||
Release: 9%{?dist}
|
Release: 10%{?dist}
|
||||||
License: MIT-Modern-Variant AND ISC AND GPL-2.0-only
|
License: MIT-Modern-Variant AND ISC AND GPL-2.0-only
|
||||||
URL: http://zsh.sourceforge.net/
|
URL: http://zsh.sourceforge.net/
|
||||||
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
|
Source0: https://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.xz
|
||||||
@ -19,10 +19,12 @@ Patch1: 0001-zsh-5.9-do-not-use-egrep-in-tests.patch
|
|||||||
Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch
|
Patch2: 0002-zsh-Use-int-main-in-test-c-codes.patch
|
||||||
# upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79
|
# upstream commit a84fdd7c8f77935ecce99ff2b0bdba738821ed79
|
||||||
Patch3: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch
|
Patch3: 0003-zsh-fix-module-loading-problem-with-full-RELRO.patch
|
||||||
# upstream commit 1b421e4978440234fb73117c8505dad1ccc68d46
|
# upstream commit 1b421e4978440234fb73117c8505dad1ccc68d46
|
||||||
Patch4: 0004-zsh-enable-PCRE-locale-switching.patch
|
Patch4: 0004-zsh-enable-PCRE-locale-switching.patch
|
||||||
# upstream commits b62e911341c8ec7446378b477c47da4256053dc0...b4d1c756f50909b4a13e5c8fe5f26f71e9d54f63
|
# upstream commit b62e911341c8ec7446378b477c47da4256053dc0 and 10bdbd8b5b0b43445aff23dcd412f25cf6aa328a
|
||||||
Patch5: 0005-zsh-port-to-pcre2.patch
|
Patch5: 0005-zsh-port-to-pcre2.patch
|
||||||
|
# upstream commit ecd3f9c9506c7720dc6c0833dc5d5eb00e4459c4
|
||||||
|
Patch6: 0006-zsh-support-texinfo-7.0.patch
|
||||||
|
|
||||||
BuildRequires: autoconf
|
BuildRequires: autoconf
|
||||||
BuildRequires: coreutils
|
BuildRequires: coreutils
|
||||||
@ -168,6 +170,10 @@ fi
|
|||||||
%doc Doc/*.html
|
%doc Doc/*.html
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 21 2023 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-10
|
||||||
|
- fix FTBFS caused by texinfo 7.1
|
||||||
|
- fix build of the PCRE module
|
||||||
|
|
||||||
* Mon Aug 21 2023 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-9
|
* Mon Aug 21 2023 Lukáš Zaoral <lzaoral@redhat.com> - 5.9-9
|
||||||
- port to PCRE 2 (rhbz#1938979)
|
- port to PCRE 2 (rhbz#1938979)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user