get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.2/patches/2220231/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2220231,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/2220231/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/buildroot/patch/20260406182217.1853895-9-bernd@kuhls.net/",
    "project": {
        "id": 27,
        "url": "http://patchwork.ozlabs.org/api/1.2/projects/27/?format=api",
        "name": "Buildroot development",
        "link_name": "buildroot",
        "list_id": "buildroot.buildroot.org",
        "list_email": "buildroot@buildroot.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": "",
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20260406182217.1853895-9-bernd@kuhls.net>",
    "list_archive_url": null,
    "date": "2026-04-06T18:22:13",
    "name": "[09/11] package/zsh: switch to pcre2",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "36faa35965c85154b81d75b708056399408c659b",
    "submitter": {
        "id": 86624,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/86624/?format=api",
        "name": "Bernd Kuhls",
        "email": "bernd@kuhls.net"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/buildroot/patch/20260406182217.1853895-9-bernd@kuhls.net/mbox/",
    "series": [
        {
            "id": 498885,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/498885/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/buildroot/list/?series=498885",
            "date": "2026-04-06T18:22:06",
            "name": "[01/11] package/wget: remove optional support for pcre, keep pcre2",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/498885/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2220231/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2220231/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<buildroot-bounces@buildroot.org>",
        "X-Original-To": [
            "incoming-buildroot@patchwork.ozlabs.org",
            "buildroot@buildroot.org"
        ],
        "Delivered-To": [
            "patchwork-incoming-buildroot@legolas.ozlabs.org",
            "buildroot@buildroot.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=buildroot.org header.i=@buildroot.org\n header.a=rsa-sha256 header.s=default header.b=Q2RLQfD3;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org\n (client-ip=2605:bc80:3010::136; helo=smtp3.osuosl.org;\n envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org)"
        ],
        "Received": [
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fqHlt3JfYz1xtJ\n\tfor <incoming-buildroot@patchwork.ozlabs.org>;\n Tue, 07 Apr 2026 04:24:10 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 195BB60AAE;\n\tMon,  6 Apr 2026 18:24:09 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id 6BTH78NrrrO9; Mon,  6 Apr 2026 18:24:07 +0000 (UTC)",
            "from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142])\n\tby smtp3.osuosl.org (Postfix) with ESMTP id 5FA2A60B25;\n\tMon,  6 Apr 2026 18:24:07 +0000 (UTC)",
            "from smtp3.osuosl.org (smtp3.osuosl.org [IPv6:2605:bc80:3010::136])\n by lists1.osuosl.org (Postfix) with ESMTP id F29051EB\n for <buildroot@buildroot.org>; Mon,  6 Apr 2026 18:24:05 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n by smtp3.osuosl.org (Postfix) with ESMTP id D83ED60B25\n for <buildroot@buildroot.org>; Mon,  6 Apr 2026 18:24:05 +0000 (UTC)",
            "from smtp3.osuosl.org ([127.0.0.1])\n by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP\n id uILWkeFWf8OD for <buildroot@buildroot.org>;\n Mon,  6 Apr 2026 18:24:04 +0000 (UTC)",
            "from dd20012.kasserver.com (dd20012.kasserver.com [85.13.140.57])\n by smtp3.osuosl.org (Postfix) with ESMTPS id E31EB60AAE\n for <buildroot@buildroot.org>; Mon,  6 Apr 2026 18:24:03 +0000 (UTC)",
            "from fli4l.lan.fli4l (p5b3a012a.dip0.t-ipconnect.de [91.58.1.42])\n by dd20012.kasserver.com (Postfix) with ESMTPSA id 86579A4C3961;\n Mon,  6 Apr 2026 20:23:02 +0200 (CEST)",
            "from bruckner.lan.fli4l ([192.168.1.1]:40236)\n by fli4l.lan.fli4l with esmtp (Exim 4.99.1)\n (envelope-from <bernd@kuhls.net>) id 1w9oaX-000000001kA-2UP2;\n Mon, 06 Apr 2026 18:22:18 +0000"
        ],
        "X-Virus-Scanned": [
            "amavis at osuosl.org",
            "amavis at osuosl.org"
        ],
        "X-Comment": "SPF check N/A for local connections - client-ip=140.211.166.142;\n helo=lists1.osuosl.org; envelope-from=buildroot-bounces@buildroot.org;\n receiver=<UNKNOWN> ",
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org 5FA2A60B25",
            "OpenDKIM Filter v2.11.0 smtp3.osuosl.org E31EB60AAE"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=buildroot.org;\n\ts=default; t=1775499847;\n\tbh=agyhdnFuK/wRSihy1X3YzT0VnsLyT7o8vpTE6rUE/UQ=;\n\th=From:To:Cc:Date:In-Reply-To:References:Subject:List-Id:\n\t List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe:\n\t From;\n\tb=Q2RLQfD3udce1Fw4mk3+lHHpkgbKKPfjM8wFxLY7894ZEuxWVa2WpFkr97DWjCYL6\n\t kOJEuYkVkm9E1oG6ztv7aHb1x9J8Dlxh4/eHwRwjAlbhJ1KWg682uab/d7k8Pv7aKm\n\t wmIvOptKv3GXJAMTALl1VRLe2fXKOxRd+EYWHEr86Pu3pehiSCwu+Dn4JYwwAY+LkX\n\t twRfEjwob+h0bg7euY0K4R/NtXaFmnfjbrKhyVPz1cU7NMkFnfjcdj6TKL2dlN6+32\n\t k5zbSCA/JCNG54jauBo1PsT8nG5VGDuf+TwM3UIS6zN5yQOmYELg6QB46cIcagr+1/\n\t wa7R1yRPbRlnQ==",
        "Received-SPF": "Pass (mailfrom) identity=mailfrom; client-ip=85.13.140.57;\n helo=dd20012.kasserver.com; envelope-from=bernd@kuhls.net;\n receiver=<UNKNOWN>",
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 smtp3.osuosl.org E31EB60AAE",
        "From": "Bernd Kuhls <bernd@kuhls.net>",
        "To": "buildroot@buildroot.org",
        "Cc": "David GOUARIN <dgouarin@gmail.com>,\n Fabrice Fontaine <fontaine.fabrice@gmail.com>,\n Laurent Cans <laurent.cans@gmail.com>, Maxim Kochetkov <fido_max@inbox.ru>,\n Phil Eichinger <phil.eichinger@gmail.com>",
        "Date": "Mon,  6 Apr 2026 20:22:13 +0200",
        "Message-ID": "<20260406182217.1853895-9-bernd@kuhls.net>",
        "X-Mailer": "git-send-email 2.47.3",
        "In-Reply-To": "<20260406182217.1853895-1-bernd@kuhls.net>",
        "References": "<20260406182217.1853895-1-bernd@kuhls.net>",
        "MIME-Version": "1.0",
        "X-Spamd-Bar": "-",
        "X-Mailman-Original-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=kuhls.net;\n s=kas202511301023; t=1775499782;\n bh=XEi0PbaHL6RD9kvW8USwLL9XVk5nq4UrqY6aAZpt3A4=;\n h=From:To:Cc:Subject:Date:In-Reply-To:From;\n b=qFyr0/LnsxnSsaTl8XrK3uEyR/HV5emI2vBm68Q89A3Jt+PSZ4X+Rmae6y59hCbnX\n SzeZqa3q/DeZkSR+y93nTYmPfSAB8NnjIzt3SXGWPDVaHgVeHrwLRAKnVPbVPAKwo0\n gdNUHDG7mjjTy1faOSQjDZWrJ8mWCFqbQp6VqlgMvghcfYG+fyN5TfaBySWP8abwCz\n JyvZ0mFesWKdzdFFYo6d04u8irokZIKmNlzs78UITMRPSfl0HnIprDYpdRTVol2S/N\n 7iZOxqwqU6vH9cXeeLhBrc1zYB3iDjM/cYl9mZgdgRLy+6n0bBEX2P/8Kbz/UYok6n\n 62iR0fhDcMxcQ==",
        "X-Mailman-Original-Authentication-Results": [
            "smtp3.osuosl.org;\n dmarc=pass (p=none dis=none)\n header.from=kuhls.net",
            "smtp3.osuosl.org;\n dkim=pass (2048-bit key,\n unprotected) header.d=kuhls.net header.i=@kuhls.net header.a=rsa-sha256\n header.s=kas202511301023 header.b=qFyr0/Ln"
        ],
        "Subject": "[Buildroot] [PATCH 09/11] package/zsh: switch to pcre2",
        "X-BeenThere": "buildroot@buildroot.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Discussion and development of buildroot <buildroot.buildroot.org>",
        "List-Unsubscribe": "<https://lists.buildroot.org/mailman/options/buildroot>,\n <mailto:buildroot-request@buildroot.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.buildroot.org/pipermail/buildroot/>",
        "List-Post": "<mailto:buildroot@buildroot.org>",
        "List-Help": "<mailto:buildroot-request@buildroot.org?subject=help>",
        "List-Subscribe": "<https://lists.buildroot.org/mailman/listinfo/buildroot>,\n <mailto:buildroot-request@buildroot.org?subject=subscribe>",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "buildroot-bounces@buildroot.org",
        "Sender": "\"buildroot\" <buildroot-bounces@buildroot.org>"
    },
    "content": "https://bbs.archlinux.org/viewtopic.php?pid=2129384#p2129384\n\nPatches 0003 and 0004 add upstream commits to support pcre2.\n\nPatch 0002 is a prerequisite for patch 0003 to apply cleanly to\nSrc/Modules/pcre.c.\n\nRenamed ac_cv_prog_ variable due to changes in patch 0004.\n\nSigned-off-by: Bernd Kuhls <bernd@kuhls.net>\n---\n ...e-to-switch-between-C-UTF-8-locales-.patch |  68 +++\n ...3-51723-migrate-pcre-module-to-pcre2.patch | 539 ++++++++++++++++++\n ...ld-pcre-module-if-pcre2-config-is-no.patch | 108 ++++\n package/zsh/zsh.mk                            |   8 +-\n 4 files changed, 720 insertions(+), 3 deletions(-)\n create mode 100644 package/zsh/0002-50658-test-Enable-to-switch-between-C-UTF-8-locales-.patch\n create mode 100644 package/zsh/0003-51723-migrate-pcre-module-to-pcre2.patch\n create mode 100644 package/zsh/0004-51877-do-not-build-pcre-module-if-pcre2-config-is-no.patch",
    "diff": "diff --git a/package/zsh/0002-50658-test-Enable-to-switch-between-C-UTF-8-locales-.patch b/package/zsh/0002-50658-test-Enable-to-switch-between-C-UTF-8-locales-.patch\nnew file mode 100644\nindex 0000000000..937fd2ee9a\n--- /dev/null\n+++ b/package/zsh/0002-50658-test-Enable-to-switch-between-C-UTF-8-locales-.patch\n@@ -0,0 +1,68 @@\n+From 6e0862221f2fadef0ec4153c7f0ca41a016144b8 Mon Sep 17 00:00:00 2001\n+From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>\n+Date: Mon, 26 Sep 2022 10:52:50 +0900\n+Subject: [PATCH] 50658 + test: Enable to switch between C/UTF-8 locales in\n+ PCRE\n+\n+Upstream: https://github.com/zsh-users/zsh/commit/1b421e4978440234fb73117c8505dad1ccc68d46\n+\n+[Bernd: backported to 5.9]\n+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>\n+---\n+ Src/Modules/pcre.c | 10 ++--------\n+ Test/V07pcre.ztst  | 11 +++++++++++\n+ 2 files changed, 13 insertions(+), 8 deletions(-)\n+\n+diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c\n+index 6289e003e..46875a59b 100644\n+--- a/Src/Modules/pcre.c\n++++ b/Src/Modules/pcre.c\n+@@ -47,8 +47,6 @@ zpcre_utf8_enabled(void)\n+ #if defined(MULTIBYTE_SUPPORT) && defined(HAVE_NL_LANGINFO) && defined(CODESET)\n+     static int have_utf8_pcre = -1;\n+ \n+-    /* value can toggle based on MULTIBYTE, so don't\n+-     * be too eager with caching */\n+     if (have_utf8_pcre < -1)\n+ \treturn 0;\n+ \n+@@ -56,15 +54,11 @@ zpcre_utf8_enabled(void)\n+ \treturn 0;\n+ \n+     if ((have_utf8_pcre == -1) &&\n+-        (!strcmp(nl_langinfo(CODESET), \"UTF-8\"))) {\n+-\n+-\tif (pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))\n++\t(pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) {\n+ \t    have_utf8_pcre = -2; /* erk, failed to ask */\n+     }\n+ \n+-    if (have_utf8_pcre < 0)\n+-\treturn 0;\n+-    return have_utf8_pcre;\n++    return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), \"UTF-8\"));\n+ \n+ #else\n+     return 0;\n+diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst\n+index c9c844d2a..ca35d43f0 100644\n+--- a/Test/V07pcre.ztst\n++++ b/Test/V07pcre.ztst\n+@@ -174,3 +174,14 @@\n+     echo $match[2] )\n+ 0:regression for segmentation fault, workers/38307\n+ >test\n++\n++  LANG_SAVE=$LANG\n++  [[ é =~ '^.\\z' ]]; echo $?\n++  LANG=C\n++  [[ é =~ '^..\\z' ]]; echo $?\n++  LANG=$LANG_SAVE\n++  [[ é =~ '^.\\z' ]]; echo $?\n++0:swich between C/UTF-8 locales\n++>0\n++>0\n++>0\n+-- \n+2.47.3\n+\ndiff --git a/package/zsh/0003-51723-migrate-pcre-module-to-pcre2.patch b/package/zsh/0003-51723-migrate-pcre-module-to-pcre2.patch\nnew file mode 100644\nindex 0000000000..a6444292fa\n--- /dev/null\n+++ b/package/zsh/0003-51723-migrate-pcre-module-to-pcre2.patch\n@@ -0,0 +1,539 @@\n+From 87cfc6e480742ac9721699530085cc07f07045b1 Mon Sep 17 00:00:00 2001\n+From: Oliver Kiddle <opk@zsh.org>\n+Date: Sat, 13 May 2023 00:53:32 +0200\n+Subject: [PATCH] 51723: migrate pcre module to pcre2\n+\n+Upstream: https://github.com/zsh-users/zsh/commit/b62e911341c8ec7446378b477c47da4256053dc0\n+\n+[Bernd: backported to 5.9]\n+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>\n+---\n+ Src/Modules/pcre.c | 223 ++++++++++++++++++---------------------------\n+ Test/V07pcre.ztst  |  13 ++-\n+ configure.ac       |  20 ++--\n+ 3 files changed, 107 insertions(+), 149 deletions(-)\n+\n+diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c\n+index 46875a59b..079ecc2c5 100644\n+--- a/Src/Modules/pcre.c\n++++ b/Src/Modules/pcre.c\n+@@ -34,11 +34,11 @@\n+ #define CPCRE_PLAIN 0\n+ \n+ /**/\n+-#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC)\n+-#include <pcre.h>\n++#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H)\n++#define PCRE2_CODE_UNIT_WIDTH 8\n++#include <pcre2.h>\n+ \n+-static pcre *pcre_pattern;\n+-static pcre_extra *pcre_hints;\n++static pcre2_code *pcre_pattern;\n+ \n+ /**/\n+ static int\n+@@ -54,8 +54,8 @@ zpcre_utf8_enabled(void)\n+ \treturn 0;\n+ \n+     if ((have_utf8_pcre == -1) &&\n+-\t(pcre_config(PCRE_CONFIG_UTF8, &have_utf8_pcre))) {\n+-\t    have_utf8_pcre = -2; /* erk, failed to ask */\n++       (pcre2_config(PCRE2_CONFIG_UNICODE, &have_utf8_pcre))) {\n++           have_utf8_pcre = -2; /* erk, failed to ask */\n+     }\n+ \n+     return (have_utf8_pcre == 1) && (!strcmp(nl_langinfo(CODESET), \"UTF-8\"));\n+@@ -69,115 +69,87 @@ zpcre_utf8_enabled(void)\n+ static int\n+ bin_pcre_compile(char *nam, char **args, Options ops, UNUSED(int func))\n+ {\n+-    int pcre_opts = 0, pcre_errptr, target_len;\n+-    const char *pcre_error;\n++    uint32_t pcre_opts = 0;\n++    int target_len;\n++    int pcre_error;\n++    PCRE2_SIZE pcre_offset;\n+     char *target;\n+     \n+-    if(OPT_ISSET(ops,'a')) pcre_opts |= PCRE_ANCHORED;\n+-    if(OPT_ISSET(ops,'i')) pcre_opts |= PCRE_CASELESS;\n+-    if(OPT_ISSET(ops,'m')) pcre_opts |= PCRE_MULTILINE;\n+-    if(OPT_ISSET(ops,'x')) pcre_opts |= PCRE_EXTENDED;\n+-    if(OPT_ISSET(ops,'s')) pcre_opts |= PCRE_DOTALL;\n++    if (OPT_ISSET(ops, 'a')) pcre_opts |= PCRE2_ANCHORED;\n++    if (OPT_ISSET(ops, 'i')) pcre_opts |= PCRE2_CASELESS;\n++    if (OPT_ISSET(ops, 'm')) pcre_opts |= PCRE2_MULTILINE;\n++    if (OPT_ISSET(ops, 'x')) pcre_opts |= PCRE2_EXTENDED;\n++    if (OPT_ISSET(ops, 's')) pcre_opts |= PCRE2_DOTALL;\n+     \n+     if (zpcre_utf8_enabled())\n+-\tpcre_opts |= PCRE_UTF8;\n+-\n+-#ifdef HAVE_PCRE_STUDY\n+-    if (pcre_hints)\n+-#ifdef PCRE_CONFIG_JIT\n+-\tpcre_free_study(pcre_hints);\n+-#else\n+-\tpcre_free(pcre_hints);\n+-#endif\n+-    pcre_hints = NULL;\n+-#endif\n++\tpcre_opts |= PCRE2_UTF;\n+ \n+     if (pcre_pattern)\n+-\tpcre_free(pcre_pattern);\n++\tpcre2_code_free(pcre_pattern);\n+     pcre_pattern = NULL;\n+ \n+     target = ztrdup(*args);\n+     unmetafy(target, &target_len);\n+ \n+-    if ((int)strlen(target) != target_len) {\n+-\tzwarnnam(nam, \"embedded NULs in PCRE pattern terminate pattern\");\n+-    }\n+-\n+-    pcre_pattern = pcre_compile(target, pcre_opts, &pcre_error, &pcre_errptr, NULL);\n++    pcre_pattern = pcre2_compile((PCRE2_SPTR) target, (PCRE2_SIZE) target_len,\n++\t    pcre_opts, &pcre_error, &pcre_offset, NULL);\n+ \n+     free(target);\n+ \n+     if (pcre_pattern == NULL)\n+     {\n+-\tzwarnnam(nam, \"error in regex: %s\", pcre_error);\n++\tPCRE2_UCHAR buffer[256];\n++\tpcre2_get_error_message(pcre_error, buffer, sizeof(buffer));\n++\tzwarnnam(nam, \"error in regex: %s\", buffer);\n+ \treturn 1;\n+     }\n+     \n+     return 0;\n+ }\n+ \n+-/**/\n+-#ifdef HAVE_PCRE_STUDY\n+-\n+ /**/\n+ static int\n+ bin_pcre_study(char *nam, UNUSED(char **args), UNUSED(Options ops), UNUSED(int func))\n+ {\n+-    const char *pcre_error;\n+-\n+     if (pcre_pattern == NULL)\n+     {\n+ \tzwarnnam(nam, \"no pattern has been compiled for study\");\n+ \treturn 1;\n+     }\n+-    \n+-    if (pcre_hints)\n+-#ifdef PCRE_CONFIG_JIT\n+-\tpcre_free_study(pcre_hints);\n+-#else\n+-\tpcre_free(pcre_hints);\n+-#endif\n+-    pcre_hints = NULL;\n+ \n+-    pcre_hints = pcre_study(pcre_pattern, 0, &pcre_error);\n+-    if (pcre_error != NULL)\n+-    {\n+-\tzwarnnam(nam, \"error while studying regex: %s\", pcre_error);\n+-\treturn 1;\n++    int jit = 0;\n++    if (!pcre2_config(PCRE2_CONFIG_JIT, &jit) && jit) {\n++\tif (pcre2_jit_compile(pcre_pattern, PCRE2_JIT_COMPLETE) < 0) {\n++\t    zwarnnam(nam, \"error while studying regex\");\n++\t    return 1;\n++\t}\n+     }\n+     \n+     return 0;\n+ }\n+ \n+-/**/\n+-#else /* !HAVE_PCRE_STUDY */\n+-\n+-# define bin_pcre_study bin_notavail\n+-\n+-/**/\n+-#endif /* !HAVE_PCRE_STUDY */\n+-\n+-/**/\n+ static int\n+-zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar,\n+-\t\t     char *substravar, int want_offset_pair, int matchedinarr,\n+-\t\t     int want_begin_end)\n++zpcre_get_substrings(char *arg, pcre2_match_data *mdata, int captured_count,\n++\tchar *matchvar, char *substravar, int want_offset_pair,\n++\tint matchedinarr, int want_begin_end)\n+ {\n+-    char **captures, *match_all, **matches;\n++    PCRE2_SIZE *ovec;\n++    char *match_all, **matches;\n+     char offset_all[50];\n+     int capture_start = 1;\n+ \n+     if (matchedinarr) {\n+-\t/* bash-style captures[0] entire-matched string in the array */\n++\t/* bash-style ovec[0] entire-matched string in the array */\n+ \tcapture_start = 0;\n+     }\n+ \n+-    /* captures[0] will be entire matched string, [1] first substring */\n+-    if (!pcre_get_substring_list(arg, ovec, captured_count, (const char ***)&captures)) {\n+-\tint nelem = arrlen(captures)-1;\n++    /* ovec[0] will be entire matched string, [1] first substring */\n++    ovec = pcre2_get_ovector_pointer(mdata);\n++    if (ovec) {\n++\tint nelem = captured_count - 1;\n+ \t/* Set to the offsets of the complete match */\n+ \tif (want_offset_pair) {\n+-\t    sprintf(offset_all, \"%d %d\", ovec[0], ovec[1]);\n++\t    sprintf(offset_all, \"%ld %ld\", ovec[0], ovec[1]);\n+ \t    setsparam(\"ZPCRE_OP\", ztrdup(offset_all));\n+ \t}\n+ \t/*\n+@@ -186,7 +158,7 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar,\n+ \t * ovec is length 2*(1+capture_list_length)\n+ \t */\n+ \tif (matchvar) {\n+-\t    match_all = metafy(captures[0], ovec[1] - ovec[0], META_DUP);\n++\t    match_all = metafy(arg + ovec[0], ovec[1] - ovec[0], META_DUP);\n+ \t    setsparam(matchvar, match_all);\n+ \t}\n+ \t/*\n+@@ -201,16 +173,12 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar,\n+ \t */\n+ \tif (substravar &&\n+ \t    (!want_begin_end || nelem)) {\n+-\t    char **x, **y;\n++\t    char **x;\n+ \t    int vec_off, i;\n+-\t    y = &captures[capture_start];\n+ \t    matches = x = (char **) zalloc(sizeof(char *) * (captured_count+1-capture_start));\n+-\t    for (i = capture_start; i < captured_count; i++, y++) {\n++\t    for (i = capture_start; i < captured_count; i++) {\n+ \t\tvec_off = 2*i;\n+-\t\tif (*y)\n+-\t\t    *x++ = metafy(*y, ovec[vec_off+1]-ovec[vec_off], META_DUP);\n+-\t\telse\n+-\t\t    *x++ = NULL;\n++\t\t*x++ = metafy(arg + ovec[vec_off], ovec[vec_off+1]-ovec[vec_off], META_DUP);\n+ \t    }\n+ \t    *x = NULL;\n+ \t    setaparam(substravar, matches);\n+@@ -247,7 +215,8 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar,\n+ \t    setiparam(\"MEND\", offs + !isset(KSHARRAYS) - 1);\n+ \t    if (nelem) {\n+ \t\tchar **mbegin, **mend, **bptr, **eptr;\n+-\t\tint i, *ipair;\n++\t\tint i;\n++\t\tsize_t *ipair;\n+ \n+ \t\tbptr = mbegin = zalloc(sizeof(char*)*(nelem+1));\n+ \t\teptr = mend = zalloc(sizeof(char*)*(nelem+1));\n+@@ -287,8 +256,6 @@ zpcre_get_substrings(char *arg, int *ovec, int captured_count, char *matchvar,\n+ \t\tsetaparam(\"mend\", mend);\n+ \t    }\n+ \t}\n+-\n+-\tpcre_free_substring_list((const char **)captures);\n+     }\n+ \n+     return 0;\n+@@ -314,7 +281,8 @@ getposint(char *instr, char *nam)\n+ static int\n+ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))\n+ {\n+-    int ret, capcount, *ovec, ovecsize, c;\n++    int ret, c;\n++    pcre2_match_data *pcre_mdata = NULL;\n+     char *matched_portion = NULL;\n+     char *plaintext = NULL;\n+     char *receptacle = NULL;\n+@@ -344,36 +312,30 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))\n+     /* For the entire match, 'Return' the offset byte positions instead of the matched string */\n+     if(OPT_ISSET(ops,'b')) want_offset_pair = 1;\n+ \n+-    if ((ret = pcre_fullinfo(pcre_pattern, pcre_hints, PCRE_INFO_CAPTURECOUNT, &capcount)))\n+-    {\n+-\tzwarnnam(nam, \"error %d in fullinfo\", ret);\n+-\treturn 1;\n+-    }\n+-\n+-    ovecsize = (capcount+1)*3;\n+-    ovec = zalloc(ovecsize*sizeof(int));\n+-\n+     plaintext = ztrdup(*args);\n+     unmetafy(plaintext, &subject_len);\n+ \n+     if (offset_start > 0 && offset_start >= subject_len)\n+-\tret = PCRE_ERROR_NOMATCH;\n+-    else\n+-\tret = pcre_exec(pcre_pattern, pcre_hints, plaintext, subject_len, offset_start, 0, ovec, ovecsize);\n++\tret = PCRE2_ERROR_NOMATCH;\n++    else {\n++\tpcre_mdata = pcre2_match_data_create_from_pattern(pcre_pattern, NULL);\n++\tret = pcre2_match(pcre_pattern, (PCRE2_SPTR) plaintext, subject_len,\n++\t\toffset_start, 0, pcre_mdata, NULL);\n++    }\n+ \n+     if (ret==0) return_value = 0;\n+-    else if (ret==PCRE_ERROR_NOMATCH) /* no match */;\n++    else if (ret == PCRE2_ERROR_NOMATCH) /* no match */;\n+     else if (ret>0) {\n+-\tzpcre_get_substrings(plaintext, ovec, ret, matched_portion, receptacle,\n++\tzpcre_get_substrings(plaintext, pcre_mdata, ret, matched_portion, receptacle,\n+ \t\t\t     want_offset_pair, 0, 0);\n+ \treturn_value = 0;\n+     }\n+     else {\n+-\tzwarnnam(nam, \"error in pcre_exec [%d]\", ret);\n++\tzwarnnam(nam, \"error in pcre2_match [%d]\", ret);\n+     }\n+     \n+-    if (ovec)\n+-\tzfree(ovec, ovecsize*sizeof(int));\n++    if (pcre_mdata)\n++\tpcre2_match_data_free(pcre_mdata);\n+     zsfree(plaintext);\n+ \n+     return return_value;\n+@@ -383,17 +345,19 @@ bin_pcre_match(char *nam, char **args, Options ops, UNUSED(int func))\n+ static int\n+ cond_pcre_match(char **a, int id)\n+ {\n+-    pcre *pcre_pat;\n+-    const char *pcre_err;\n++    pcre2_code *pcre_pat = NULL;\n++    int pcre_err;\n++    PCRE2_SIZE pcre_erroff;\n+     char *lhstr, *rhre, *lhstr_plain, *rhre_plain, *avar, *svar;\n+-    int r = 0, pcre_opts = 0, pcre_errptr, capcnt, *ov, ovsize;\n++    int r = 0, pcre_opts = 0;\n++    pcre2_match_data *pcre_mdata = NULL;\n+     int lhstr_plain_len, rhre_plain_len;\n+     int return_value = 0;\n+ \n+     if (zpcre_utf8_enabled())\n+-\tpcre_opts |= PCRE_UTF8;\n++\tpcre_opts |= PCRE2_UTF;\n+     if (isset(REMATCHPCRE) && !isset(CASEMATCH))\n+-\tpcre_opts |= PCRE_CASELESS;\n++\tpcre_opts |= PCRE2_CASELESS;\n+ \n+     lhstr = cond_str(a,0,0);\n+     rhre = cond_str(a,1,0);\n+@@ -401,9 +365,6 @@ cond_pcre_match(char **a, int id)\n+     rhre_plain = ztrdup(rhre);\n+     unmetafy(lhstr_plain, &lhstr_plain_len);\n+     unmetafy(rhre_plain, &rhre_plain_len);\n+-    pcre_pat = NULL;\n+-    ov = NULL;\n+-    ovsize = 0;\n+ \n+     if (isset(BASHREMATCH)) {\n+ \tsvar = NULL;\n+@@ -415,27 +376,27 @@ cond_pcre_match(char **a, int id)\n+ \n+     switch(id) {\n+ \t case CPCRE_PLAIN:\n+-\t\tif ((int)strlen(rhre_plain) != rhre_plain_len) {\n+-\t\t    zwarn(\"embedded NULs in PCRE pattern terminate pattern\");\n+-\t\t}\n+-\t\tpcre_pat = pcre_compile(rhre_plain, pcre_opts, &pcre_err, &pcre_errptr, NULL);\n+-\t\tif (pcre_pat == NULL) {\n+-\t\t    zwarn(\"failed to compile regexp /%s/: %s\", rhre, pcre_err);\n++\t\tif (!(pcre_pat = pcre2_compile((PCRE2_SPTR) rhre_plain,\n++\t\t\t(PCRE2_SIZE) rhre_plain_len, pcre_opts,\n++\t\t\t&pcre_err, &pcre_erroff, NULL)))\n++\t\t{\n++\t\t    PCRE2_UCHAR buffer[256];\n++\t\t    pcre2_get_error_message(pcre_err, buffer, sizeof(buffer));\n++\t\t    zwarn(\"failed to compile regexp /%s/: %s\", rhre, buffer);\n+ \t\t    break;\n+ \t\t}\n+-                pcre_fullinfo(pcre_pat, NULL, PCRE_INFO_CAPTURECOUNT, &capcnt);\n+-    \t\tovsize = (capcnt+1)*3;\n+-\t\tov = zalloc(ovsize*sizeof(int));\n+-    \t\tr = pcre_exec(pcre_pat, NULL, lhstr_plain, lhstr_plain_len, 0, 0, ov, ovsize);\n+-\t\t/* r < 0 => error; r==0 match but not enough size in ov\n++\t\tpcre_mdata = pcre2_match_data_create_from_pattern(pcre_pat, NULL);\n++\t\tr = pcre2_match(pcre_pat, (PCRE2_SPTR8) lhstr_plain, lhstr_plain_len,\n++\t\t\t0, 0, pcre_mdata, NULL);\n++\t\t/* r < 0 => error; r==0 match but not enough size in match data\n+ \t\t * r > 0 => (r-1) substrings found; r==1 => no substrings\n+ \t\t */\n+     \t\tif (r==0) {\n+-\t\t    zwarn(\"reportable zsh problem: pcre_exec() returned 0\");\n++\t\t    zwarn(\"reportable zsh problem: pcre2_match() returned 0\");\n+ \t\t    return_value = 1;\n+ \t\t    break;\n+ \t\t}\n+-\t        else if (r==PCRE_ERROR_NOMATCH) {\n++\t\telse if (r == PCRE2_ERROR_NOMATCH) {\n+ \t\t    return_value = 0; /* no match */\n+ \t\t    break;\n+ \t\t}\n+@@ -444,7 +405,7 @@ cond_pcre_match(char **a, int id)\n+ \t\t    break;\n+ \t\t}\n+                 else if (r>0) {\n+-\t\t    zpcre_get_substrings(lhstr_plain, ov, r, svar, avar, 0,\n++\t\t    zpcre_get_substrings(lhstr_plain, pcre_mdata, r, svar, avar, 0,\n+ \t\t\t\t\t isset(BASHREMATCH),\n+ \t\t\t\t\t !isset(BASHREMATCH));\n+ \t\t    return_value = 1;\n+@@ -457,10 +418,10 @@ cond_pcre_match(char **a, int id)\n+ \tfree(lhstr_plain);\n+     if(rhre_plain)\n+ \tfree(rhre_plain);\n++    if (pcre_mdata)\n++\tpcre2_match_data_free(pcre_mdata);\n+     if (pcre_pat)\n+-\tpcre_free(pcre_pat);\n+-    if (ov)\n+-\tzfree(ov, ovsize*sizeof(int));\n++\tpcre2_code_free(pcre_pat);\n+ \n+     return return_value;\n+ }\n+@@ -489,11 +450,11 @@ static struct builtin bintab[] = {\n+ \n+ static struct features module_features = {\n+     bintab, sizeof(bintab)/sizeof(*bintab),\n+-#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC)\n++#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H)\n+     cotab, sizeof(cotab)/sizeof(*cotab),\n+-#else /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */\n++#else /* !(HAVE_PCRE2_COMPILE_8 && HAVE_PCRE2_H) */\n+     NULL, 0,\n+-#endif /* !(HAVE_PCRE_COMPILE && HAVE_PCRE_EXEC) */\n++#endif /* !(HAVE_PCRE2_COMPILE_8 && HAVE_PCRE2_H) */\n+     NULL, 0,\n+     NULL, 0,\n+     0\n+@@ -540,19 +501,9 @@ cleanup_(Module m)\n+ int\n+ finish_(UNUSED(Module m))\n+ {\n+-#if defined(HAVE_PCRE_COMPILE) && defined(HAVE_PCRE_EXEC)\n+-#ifdef HAVE_PCRE_STUDY\n+-    if (pcre_hints)\n+-#ifdef PCRE_CONFIG_JIT\n+-\tpcre_free_study(pcre_hints);\n+-#else\n+-\tpcre_free(pcre_hints);\n+-#endif\n+-    pcre_hints = NULL;\n+-#endif\n+-\n++#if defined(HAVE_PCRE2_COMPILE_8) && defined(HAVE_PCRE2_H)\n+     if (pcre_pattern)\n+-\tpcre_free(pcre_pattern);\n++\tpcre2_code_free(pcre_pattern);\n+     pcre_pattern = NULL;\n+ #endif\n+ \n+diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst\n+index ca35d43f0..0129ddc94 100644\n+--- a/Test/V07pcre.ztst\n++++ b/Test/V07pcre.ztst\n+@@ -129,12 +129,17 @@\n+ >78884; ZPCRE_OP: 25 30\n+ >90210; ZPCRE_OP: 31 36\n+ \n+-# Embedded NULs allowed in plaintext, but not in RE (although \\0 as two-chars allowed)\n++# Embedded NULs allowed in plaintext, in RE, pcre supports \\0 as two-chars\n+   [[ $'a\\0bc\\0d' =~ '^(a\\0.)(.+)$' ]]\n+   print \"${#MATCH}; ${#match[1]}; ${#match[2]}\"\n+ 0:ensure ASCII NUL passes in and out of matched plaintext\n+ >6; 3; 3\n+ \n++# PCRE2 supports NULs also in the RE\n++  [[ $'a\\0b\\0c' =~ $'^(.\\0)+' ]] && print \"${#MATCH}; ${#match[1]}\"\n++0:ensure ASCII NUL works also in the regex\n++>4; 2\n++\n+ # Ensure the long-form infix operator works\n+   [[ foo -pcre-match ^f..$ ]]\n+   print $?\n+@@ -181,7 +186,11 @@\n+   [[ é =~ '^..\\z' ]]; echo $?\n+   LANG=$LANG_SAVE\n+   [[ é =~ '^.\\z' ]]; echo $?\n+-0:swich between C/UTF-8 locales\n++0:switch between C/UTF-8 locales\n+ >0\n+ >0\n+ >0\n++\n++  [[ abc =~ 'a(d*)bc' ]] && print \"$#MATCH; $#match; ${#match[1]}\"\n++0:empty capture\n++>3; 1; 0\n+diff --git a/configure.ac b/configure.ac\n+index b4d3e1f96..a31b32b4e 100644\n+--- a/configure.ac\n++++ b/configure.ac\n+@@ -438,7 +438,7 @@ fi],\n+ \n+ dnl Do you want to look for pcre support?\n+ AC_ARG_ENABLE(pcre,\n+-AS_HELP_STRING([--enable-pcre],[enable the search for the pcre library (may create run-time library dependencies)]))\n++AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)]))\n+ \n+ dnl Do you want to look for capability support?\n+ AC_ARG_ENABLE(cap,\n+@@ -662,13 +662,12 @@ AC_HEADER_SYS_WAIT\n+ \n+ oldcflags=\"$CFLAGS\"\n+ if test x$enable_pcre = xyes; then\n+-AC_CHECK_PROG([PCRECONF], pcre-config, pcre-config)\n+-dnl Typically (meaning on this single RedHat 9 box in front of me)\n+-dnl pcre-config --cflags produces a -I output which needs to go into\n++AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config)\n++dnl pcre2-config --cflags may produce a -I output which needs to go into\n+ dnl CPPFLAGS else configure's preprocessor tests don't pick it up,\n+ dnl producing a warning.\n+-if test \"x$ac_cv_prog_PCRECONF\" = xpcre-config; then\n+-  CPPFLAGS=\"$CPPFLAGS `pcre-config --cflags`\"\n++if test \"x$ac_cv_prog_PCRECONF\" = xpcre2-config; then\n++  CPPFLAGS=\"$CPPFLAGS `pcre2-config --cflags`\"\n+ fi\n+ fi\n+ \n+@@ -678,9 +677,10 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \\\n+ \t\t locale.h errno.h stdio.h stdarg.h varargs.h stdlib.h \\\n+ \t\t unistd.h sys/capability.h \\\n+ \t\t utmp.h utmpx.h sys/types.h pwd.h grp.h poll.h sys/mman.h \\\n+-\t\t netinet/in_systm.h pcre.h langinfo.h wchar.h stddef.h \\\n++\t\t netinet/in_systm.h langinfo.h wchar.h stddef.h \\\n+ \t\t sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \\\n+ \t\t ncurses/ncurses.h)\n++AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])\n+ if test x$dynamic = xyes; then\n+   AC_CHECK_HEADERS(dlfcn.h)\n+   AC_CHECK_HEADERS(dl.h)\n+@@ -958,9 +958,7 @@ if test \"x$ac_found_iconv\" = \"xyes\"; then\n+ fi\n+ \n+ if test x$enable_pcre = xyes; then\n+-dnl pcre-config should probably be employed here\n+-dnl AC_SEARCH_LIBS(pcre_compile, pcre)\n+-  LIBS=\"`$ac_cv_prog_PCRECONF --libs` $LIBS\"\n++  LIBS=\"`$ac_cv_prog_PCRECONF --libs8` $LIBS\"\n+ fi\n+ \n+ dnl ---------------------\n+@@ -1323,7 +1321,7 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \\\n+ \t       pathconf sysconf \\\n+ \t       tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \\\n+ \t       getcchar setcchar waddwstr wget_wch win_wch use_default_colors \\\n+-\t       pcre_compile pcre_study pcre_exec \\\n++\t       pcre2_compile_8 \\\n+ \t       nl_langinfo \\\n+ \t       erand48 open_memstream \\\n+ \t       posix_openpt \\\n+-- \n+2.47.3\n+\ndiff --git a/package/zsh/0004-51877-do-not-build-pcre-module-if-pcre2-config-is-no.patch b/package/zsh/0004-51877-do-not-build-pcre-module-if-pcre2-config-is-no.patch\nnew file mode 100644\nindex 0000000000..78ab9e7b1e\n--- /dev/null\n+++ b/package/zsh/0004-51877-do-not-build-pcre-module-if-pcre2-config-is-no.patch\n@@ -0,0 +1,108 @@\n+From 041c553ed62e2c3f5a9444b82463a330555ad347 Mon Sep 17 00:00:00 2001\n+From: Jun-ichi Takimoto <takimoto-j@kba.biglobe.ne.jp>\n+Date: Tue, 20 Jun 2023 18:14:27 +0900\n+Subject: [PATCH] 51877: do not build pcre module if pcre2-config is not found\n+\n+Upstream: https://github.com/zsh-users/zsh/commit/10bdbd8b5b0b43445aff23dcd412f25cf6aa328a\n+\n+[Bernd: backported to 5.9]\n+Signed-off-by: Bernd Kuhls <bernd@kuhls.net>\n+---\n+ Src/Modules/pcre.mdd |  2 +-\n+ configure.ac         | 31 +++++++++++++++++++------------\n+ 2 files changed, 20 insertions(+), 13 deletions(-)\n+\n+diff --git a/Src/Modules/pcre.mdd b/Src/Modules/pcre.mdd\n+index 6eb3c691b..3e1579117 100644\n+--- a/Src/Modules/pcre.mdd\n++++ b/Src/Modules/pcre.mdd\n+@@ -1,5 +1,5 @@\n+ name=zsh/pcre\n+-link=`if test x$enable_pcre = xyes && (pcre-config --version >/dev/null 2>/dev/null); then echo dynamic; else echo no; fi`\n++link=`if test x$enable_pcre = xyes; then echo dynamic; else echo no; fi`\n+ load=no\n+ \n+ autofeatures=\"b:pcre_compile b:pcre_study b:pcre_match\"\n+diff --git a/configure.ac b/configure.ac\n+index a31b32b4e..770a788e8 100644\n+--- a/configure.ac\n++++ b/configure.ac\n+@@ -440,6 +440,17 @@ dnl Do you want to look for pcre support?\n+ AC_ARG_ENABLE(pcre,\n+ AS_HELP_STRING([--enable-pcre],[enable the search for the pcre2 library (may create run-time library dependencies)]))\n+ \n++AC_ARG_VAR(PCRE_CONFIG, [pathname of pcre2-config if it is not in PATH])\n++if test \"x$enable_pcre\" = xyes; then\n++  AC_CHECK_PROG([PCRE_CONFIG], pcre2-config, pcre2-config)\n++  if test \"x$PCRE_CONFIG\" = x; then\n++    enable_pcre=no\n++    AC_MSG_WARN([pcre2-config not found: pcre module is disabled.])\n++    AC_MSG_NOTICE(\n++      [Set PCRE_CONFIG to pathname of pcre2-config if it is not in PATH.])\n++  fi\n++fi\n++\n+ dnl Do you want to look for capability support?\n+ AC_ARG_ENABLE(cap,\n+ AS_HELP_STRING([--enable-cap],[enable the search for POSIX capabilities (may require additional headers to be added by hand)]))\n+@@ -660,15 +671,12 @@ AC_HEADER_DIRENT\n+ AC_HEADER_STAT\n+ AC_HEADER_SYS_WAIT\n+ \n+-oldcflags=\"$CFLAGS\"\n+-if test x$enable_pcre = xyes; then\n+-AC_CHECK_PROG([PCRECONF], pcre2-config, pcre2-config)\n+ dnl pcre2-config --cflags may produce a -I output which needs to go into\n+ dnl CPPFLAGS else configure's preprocessor tests don't pick it up,\n+ dnl producing a warning.\n+-if test \"x$ac_cv_prog_PCRECONF\" = xpcre2-config; then\n+-  CPPFLAGS=\"$CPPFLAGS `pcre2-config --cflags`\"\n+-fi\n++if test \"x$enable_pcre\" = xyes; then\n++  CPPFLAGS=\"`$PCRE_CONFIG --cflags` $CPPFLAGS\"\n++  AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])\n+ fi\n+ \n+ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \\\n+@@ -680,7 +688,6 @@ AC_CHECK_HEADERS(sys/time.h sys/times.h sys/select.h termcap.h termio.h \\\n+ \t\t netinet/in_systm.h langinfo.h wchar.h stddef.h \\\n+ \t\t sys/stropts.h iconv.h ncurses.h ncursesw/ncurses.h \\\n+ \t\t ncurses/ncurses.h)\n+-AC_CHECK_HEADERS([pcre2.h],,,[#define PCRE2_CODE_UNIT_WIDTH 8])\n+ if test x$dynamic = xyes; then\n+   AC_CHECK_HEADERS(dlfcn.h)\n+   AC_CHECK_HEADERS(dl.h)\n+@@ -957,10 +964,6 @@ if test \"x$ac_found_iconv\" = \"xyes\"; then\n+     [Define as const if the declaration of iconv() needs const.])\n+ fi\n+ \n+-if test x$enable_pcre = xyes; then\n+-  LIBS=\"`$ac_cv_prog_PCRECONF --libs8` $LIBS\"\n+-fi\n+-\n+ dnl ---------------------\n+ dnl CHECK TERMCAP LIBRARY\n+ dnl ---------------------\n+@@ -1321,7 +1324,6 @@ AC_CHECK_FUNCS(strftime strptime mktime timelocal \\\n+ \t       pathconf sysconf \\\n+ \t       tgetent tigetflag tigetnum tigetstr setupterm initscr resize_term \\\n+ \t       getcchar setcchar waddwstr wget_wch win_wch use_default_colors \\\n+-\t       pcre2_compile_8 \\\n+ \t       nl_langinfo \\\n+ \t       erand48 open_memstream \\\n+ \t       posix_openpt \\\n+@@ -1376,6 +1378,11 @@ if test x$zsh_cv_func_realpath_accepts_null = xyes; then\n+   AC_DEFINE(REALPATH_ACCEPTS_NULL)\n+ fi\n+ \n++if test x$enable_pcre = xyes; then\n++  LIBS=\"`$PCRE_CONFIG --libs8` $LIBS\"\n++  AC_CHECK_FUNCS(pcre2_compile_8)\n++fi\n++\n+ if test x$enable_cap = xyes; then\n+   AC_CHECK_FUNCS(cap_get_proc)\n+ fi\n+-- \n+2.47.3\n+\ndiff --git a/package/zsh/zsh.mk b/package/zsh/zsh.mk\nindex 7e577fa9e1..2c464c33a8 100644\n--- a/package/zsh/zsh.mk\n+++ b/package/zsh/zsh.mk\n@@ -14,6 +14,8 @@ ZSH_LICENSE = MIT-like\n ZSH_LICENSE_FILES = LICENCE\n ZSH_CPE_ID_VENDOR = zsh\n # 0001-52383-Avoid-incompatible-pointer-types-in-terminfo-global-variable.patch\n+# 0003-51723-migrate-pcre-module-to-pcre2.patch\n+# 0004-51877-do-not-build-pcre-module-if-pcre2-config-is-no.patch\n ZSH_AUTORECONF = YES\n \n # zsh uses TRY_RUN to determine these\n@@ -38,10 +40,10 @@ else\n ZSH_CONF_OPTS += --disable-cap\n endif\n \n-ifeq ($(BR2_PACKAGE_PCRE),y)\n+ifeq ($(BR2_PACKAGE_PCRE2),y)\n ZSH_CONF_OPTS += --enable-pcre\n-ZSH_CONF_ENV += ac_cv_prog_PCRECONF=$(STAGING_DIR)/usr/bin/pcre-config\n-ZSH_DEPENDENCIES += pcre\n+ZSH_CONF_ENV += ac_cv_prog_PCRE_CONFIG=$(STAGING_DIR)/usr/bin/pcre2-config\n+ZSH_DEPENDENCIES += pcre2\n else\n ZSH_CONF_OPTS += --disable-pcre\n endif\n",
    "prefixes": [
        "09/11"
    ]
}