commit:     cb8b981252e741096e9bf492471ba6fc6430b852
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 23 04:28:57 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 23 04:33:00 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cb8b9812

app-shells/bash: require Bison as yacc implementation

Upstream only test with Bison and require GNUisms like YYEOF and
YYERRCODE. The former at least may be in POSIX soon:
https://www.austingroupbugs.net/view.php?id=1269.

configure warns on use of non-Bison but doesn't abort. The result
may misbehave at runtime.

Noticed with recently added bash-5.2_p15-shell-parser-reset-issue.patch
(which is blameless in itself).

A simple test with a broken Bash is:
```
$ /var/tmp/portage/app-shells/bash-5.2_p15-r4/image/bin/bash -n 
/lib/gentoo/functions.sh
/lib/gentoo/functions.sh: line 104: syntax error near unexpected token `}'
/lib/gentoo/functions.sh: line 104: `}'
```

Reference: 3ee2d707a299f352b6970af459b0c25c356cbb25
Reference: dde3a81f420e745fe884b6535796129192f02561
Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-shells/bash/bash-4.2_p53.ebuild                         | 13 ++++++++++---
 app-shells/bash/bash-4.3_p48-r2.ebuild                      | 11 +++++++++--
 app-shells/bash/bash-4.4_p23-r2.ebuild                      | 11 +++++++++--
 .../bash/{bash-5.0_p18-r1.ebuild => bash-5.0_p18-r2.ebuild} | 11 +++++++++--
 .../bash/{bash-5.1_p16-r4.ebuild => bash-5.1_p16-r6.ebuild} | 11 +++++++++--
 .../bash/{bash-5.1_p16-r5.ebuild => bash-5.1_p16-r7.ebuild} | 11 +++++++++--
 .../bash/{bash-5.2_p15-r3.ebuild => bash-5.2_p15-r5.ebuild} | 11 +++++++++--
 .../bash/{bash-5.2_p15-r4.ebuild => bash-5.2_p15-r6.ebuild} | 11 +++++++++--
 app-shells/bash/bash-9999.ebuild                            | 11 +++++++++--
 profiles/package.mask                                       |  2 +-
 10 files changed, 83 insertions(+), 20 deletions(-)

diff --git a/app-shells/bash/bash-4.2_p53.ebuild 
b/app-shells/bash/bash-4.2_p53.ebuild
index b5ae0c39892b..fc1a7772d2da 100644
--- a/app-shells/bash/bash-4.2_p53.ebuild
+++ b/app-shells/bash/bash-4.2_p53.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
@@ -50,8 +50,8 @@ LIB_DEPEND=">=sys-libs/ncurses-5.2-r2[static-libs(+)]
 RDEPEND="!static? ( ${LIB_DEPEND//\[static-libs(+)]} )"
 DEPEND="${RDEPEND}
        static? ( ${LIB_DEPEND} )"
-# We only need yacc when the .y files get patched (bash42-005)
-BDEPEND="app-alternatives/yacc"
+# We only need bison (yacc) when the .y files get patched (bash42-005)
+BDEPEND="sys-devel/bison"
 
 S="${WORKDIR}/${MY_P}"
 
@@ -97,6 +97,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --with-installed-readline=.
 

diff --git a/app-shells/bash/bash-4.3_p48-r2.ebuild 
b/app-shells/bash/bash-4.3_p48-r2.ebuild
index fa5b257be9da..6315ebdb8789 100644
--- a/app-shells/bash/bash-4.3_p48-r2.ebuild
+++ b/app-shells/bash/bash-4.3_p48-r2.ebuild
@@ -53,8 +53,8 @@ DEPEND=">=sys-libs/ncurses-5.2-r2:0=
        nls? ( virtual/libintl )"
 RDEPEND="${DEPEND}
        !<sys-apps/portage-2.1.6.7_p1"
-# We only need yacc when the .y files get patched (bash42-005)
-BDEPEND="app-alternatives/yacc"
+# We only need bison (yacc) when the .y files get patched (bash42-005)
+BDEPEND="sys-devel/bison"
 
 PATCHES=(
        
"${WORKDIR}"/${P}-r2-patches/${PN}-4.3-mapfile-improper-array-name-validation.patch
@@ -106,6 +106,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --docdir='$(datarootdir)'/doc/${PF}
                --htmldir='$(docdir)/html'

diff --git a/app-shells/bash/bash-4.4_p23-r2.ebuild 
b/app-shells/bash/bash-4.4_p23-r2.ebuild
index 47f6a05f86c6..8e5a6a55381c 100644
--- a/app-shells/bash/bash-4.4_p23-r2.ebuild
+++ b/app-shells/bash/bash-4.4_p23-r2.ebuild
@@ -65,8 +65,8 @@ DEPEND="
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005)
-#BDEPEND="app-alternatives/yacc"
+# We only need bison (yacc) when the .y files get patched (bash42-005)
+#BDEPEND="sys-devel/bison"
 
 S="${WORKDIR}/${MY_P}"
 
@@ -117,6 +117,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/app-shells/bash/bash-5.0_p18-r1.ebuild 
b/app-shells/bash/bash-5.0_p18-r2.ebuild
similarity index 94%
rename from app-shells/bash/bash-5.0_p18-r1.ebuild
rename to app-shells/bash/bash-5.0_p18-r2.ebuild
index 8634159cb122..b408b7842312 100644
--- a/app-shells/bash/bash-5.0_p18-r1.ebuild
+++ b/app-shells/bash/bash-5.0_p18-r2.ebuild
@@ -65,8 +65,8 @@ DEPEND="
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005)
-#BDEPEND="app-alternatives/yacc"
+# We only need bison (yacc) when the .y files get patched (bash42-005)
+BDEPEND="sys-devel/bison"
 
 S="${WORKDIR}/${MY_P}"
 
@@ -121,6 +121,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/app-shells/bash/bash-5.1_p16-r4.ebuild 
b/app-shells/bash/bash-5.1_p16-r6.ebuild
similarity index 95%
rename from app-shells/bash/bash-5.1_p16-r4.ebuild
rename to app-shells/bash/bash-5.1_p16-r6.ebuild
index 25028ea0a987..efc8d77257d1 100644
--- a/app-shells/bash/bash-5.1_p16-r4.ebuild
+++ b/app-shells/bash/bash-5.1_p16-r6.ebuild
@@ -90,8 +90,8 @@ DEPEND="
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005, bash51-011)
-BDEPEND="app-alternatives/yacc
+# We only need bison (yacc) when the .y files get patched (bash42-005, 
bash51-011)
+BDEPEND="sys-devel/bison
        verify-sig? ( sec-keys/openpgp-keys-chetramey )"
 
 S="${WORKDIR}/${MY_P}"
@@ -159,6 +159,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/app-shells/bash/bash-5.1_p16-r5.ebuild 
b/app-shells/bash/bash-5.1_p16-r7.ebuild
similarity index 95%
rename from app-shells/bash/bash-5.1_p16-r5.ebuild
rename to app-shells/bash/bash-5.1_p16-r7.ebuild
index 230aaaf033a5..8595694838e9 100644
--- a/app-shells/bash/bash-5.1_p16-r5.ebuild
+++ b/app-shells/bash/bash-5.1_p16-r7.ebuild
@@ -90,8 +90,8 @@ DEPEND="
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005, bash51-011)
-BDEPEND="app-alternatives/yacc
+# We only need bison (yacc) when the .y files get patched (bash42-005, 
bash51-011)
+BDEPEND="sys-devel/bison
        verify-sig? ( sec-keys/openpgp-keys-chetramey )"
 
 S="${WORKDIR}/${MY_P}"
@@ -161,6 +161,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/app-shells/bash/bash-5.2_p15-r3.ebuild 
b/app-shells/bash/bash-5.2_p15-r5.ebuild
similarity index 96%
rename from app-shells/bash/bash-5.2_p15-r3.ebuild
rename to app-shells/bash/bash-5.2_p15-r5.ebuild
index 4d0dbeb3877d..a107c639ef8d 100644
--- a/app-shells/bash/bash-5.2_p15-r3.ebuild
+++ b/app-shells/bash/bash-5.2_p15-r5.ebuild
@@ -98,9 +98,9 @@ fi
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005, bash51-011)
+# We only need bison (yacc) when the .y files get patched (bash42-005, 
bash51-011)
 BDEPEND="
-       app-alternatives/yacc
+       sys-devel/bison
        pgo? ( dev-util/gperf )
        verify-sig? ( sec-keys/openpgp-keys-chetramey )
 "
@@ -180,6 +180,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/app-shells/bash/bash-5.2_p15-r4.ebuild 
b/app-shells/bash/bash-5.2_p15-r6.ebuild
similarity index 96%
rename from app-shells/bash/bash-5.2_p15-r4.ebuild
rename to app-shells/bash/bash-5.2_p15-r6.ebuild
index 04710a4c180f..e0c1a7b28b88 100644
--- a/app-shells/bash/bash-5.2_p15-r4.ebuild
+++ b/app-shells/bash/bash-5.2_p15-r6.ebuild
@@ -98,9 +98,9 @@ fi
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005, bash51-011)
+# We only need bison (yacc) when the .y files get patched (bash42-005, 
bash51-011)
 BDEPEND="
-       app-alternatives/yacc
+       sys-devel/bison
        pgo? ( dev-util/gperf )
        verify-sig? ( sec-keys/openpgp-keys-chetramey )
 "
@@ -181,6 +181,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/app-shells/bash/bash-9999.ebuild b/app-shells/bash/bash-9999.ebuild
index af8066bbfd29..eeff3e0b3023 100644
--- a/app-shells/bash/bash-9999.ebuild
+++ b/app-shells/bash/bash-9999.ebuild
@@ -98,9 +98,9 @@ fi
 RDEPEND="
        ${DEPEND}
 "
-# We only need yacc when the .y files get patched (bash42-005, bash51-011)
+# We only need bison (yacc) when the .y files get patched (bash42-005, 
bash51-011)
 BDEPEND="
-       app-alternatives/yacc
+       sys-devel/bison
        pgo? ( dev-util/gperf )
        verify-sig? ( sec-keys/openpgp-keys-chetramey )
 "
@@ -178,6 +178,13 @@ src_prepare() {
 }
 
 src_configure() {
+       # Upstream only test with Bison and require GNUisms like YYEOF and
+       # YYERRCODE. The former at least may be in POSIX soon:
+       # https://www.austingroupbugs.net/view.php?id=1269.
+       # configure warns on use of non-Bison but doesn't abort. The result
+       # may misbehave at runtime.
+       unset YACC
+
        local myconf=(
                --disable-profiling
 

diff --git a/profiles/package.mask b/profiles/package.mask
index ff0c1b9d6769..6f40aef60e9a 100644
--- a/profiles/package.mask
+++ b/profiles/package.mask
@@ -34,7 +34,7 @@
 #--- END OF EXAMPLES ---
 
 # Sam James <s...@gentoo.org> (2023-06-23)
-# Causes bash to segfault in some cases.
+# Segfaults with non-bison yacc.
 =app-shells/bash-5.2_p15-r4
 
 # Matt Turner <matts...@gentoo.org> (2023-06-22)

Reply via email to