-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update bash #18074
Update bash #18074
Conversation
Changes: - tianon/docker-bash@84c54c9: Merge pull request tianon/docker-bash#43 from self-five/alpine3.21 - tianon/docker-bash@4811b83: Update all versions to Alpine 3.21 - tianon/docker-bash@712b1f0: Merge pull request tianon/docker-bash#42 from self-five/usr-local-src - tianon/docker-bash@1026f2a: Switch to `/usr/local/src` - tianon/docker-bash@49569c3: Update devel to alpine 3.21 - tianon/docker-bash@8569e48: Update 5.3-rc to alpine 3.21 - tianon/docker-bash@6b4b452: Update 5.2 to alpine 3.21 - tianon/docker-bash@3840dea: Update 5.1 to alpine 3.21
Quoting from tianon/docker-bash#43, to be explicit:
|
Diff for 7262054:diff --git a/_bashbrew-cat b/_bashbrew-cat
index a1aacc8..317d9c8 100644
--- a/_bashbrew-cat
+++ b/_bashbrew-cat
@@ -1,67 +1,67 @@
Maintainers: Tianon Gravi <[email protected]> (@tianon)
GitRepo: https://github.com/tianon/docker-bash.git
-Tags: 3.0.22, 3.0, 3.0.22-alpine3.20, 3.0-alpine3.20
+Tags: 3.0.22, 3.0, 3.0.22-alpine3.21, 3.0-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 70ab2885f72c548029c8121364a553c35e7a68bb
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 3.0
-Tags: 3.1.23, 3.1, 3.1.23-alpine3.20, 3.1-alpine3.20
+Tags: 3.1.23, 3.1, 3.1.23-alpine3.21, 3.1-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: a83617b0ccad194449d1b3302900d0e3da9208b0
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 3.1
-Tags: 3.2.57, 3.2, 3, 3.2.57-alpine3.20, 3.2-alpine3.20, 3-alpine3.20
+Tags: 3.2.57, 3.2, 3, 3.2.57-alpine3.21, 3.2-alpine3.21, 3-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: bd69755669b80037ca0d1e2181a823860af9737d
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 3.2
-Tags: 4.0.44, 4.0, 4.0.44-alpine3.20, 4.0-alpine3.20
+Tags: 4.0.44, 4.0, 4.0.44-alpine3.21, 4.0-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 94dfac8edcd2f9cab9ad6277d5b621d3b68ed865
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 4.0
-Tags: 4.1.17, 4.1, 4.1.17-alpine3.20, 4.1-alpine3.20
+Tags: 4.1.17, 4.1, 4.1.17-alpine3.21, 4.1-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 9e8e378aa52eebb91a1c74b9b4b8db724d4cef95
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 4.1
-Tags: 4.2.53, 4.2, 4.2.53-alpine3.20, 4.2-alpine3.20
+Tags: 4.2.53, 4.2, 4.2.53-alpine3.21, 4.2-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 05f9e93fbf2b995ee28a757b3cbcd0ae8d90445c
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 4.2
-Tags: 4.3.48, 4.3, 4.3.48-alpine3.20, 4.3-alpine3.20
+Tags: 4.3.48, 4.3, 4.3.48-alpine3.21, 4.3-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 0f38d86a4e6b5431d22f2afb2bd7c181221ad7d7
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 4.3
-Tags: 4.4.23, 4.4, 4, 4.4.23-alpine3.20, 4.4-alpine3.20, 4-alpine3.20
+Tags: 4.4.23, 4.4, 4, 4.4.23-alpine3.21, 4.4-alpine3.21, 4-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: f7d533503f4423a7542fd5479b053a35027025a1
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 4.4
-Tags: 5.0.18, 5.0, 5.0.18-alpine3.20, 5.0-alpine3.20
+Tags: 5.0.18, 5.0, 5.0.18-alpine3.21, 5.0-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 699819eee5befbf7ac7f906e7a30171287de720b
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: 5.0
-Tags: 5.1.16, 5.1, 5.1.16-alpine3.20, 5.1-alpine3.20
+Tags: 5.1.16, 5.1, 5.1.16-alpine3.21, 5.1-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: afbd6361eb8ec05bb0ea5fcfb118a69eb59b539d
+GitCommit: 712b1f0c63d45c37d1072e6e9e635da1edfb0734
Directory: 5.1
-Tags: 5.2.37, 5.2, 5, latest, 5.2.37-alpine3.20, 5.2-alpine3.20, 5-alpine3.20, alpine3.20
+Tags: 5.2.37, 5.2, 5, latest, 5.2.37-alpine3.21, 5.2-alpine3.21, 5-alpine3.21, alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: acac9dc9fc2a2c62f83d20e463f213cc0c028197
+GitCommit: 712b1f0c63d45c37d1072e6e9e635da1edfb0734
Directory: 5.2
-Tags: 5.3-alpha, 5.3-rc, rc, 5.3-alpha-alpine3.20, 5.3-rc-alpine3.20, rc-alpine3.20
+Tags: 5.3-alpha, 5.3-rc, rc, 5.3-alpha-alpine3.21, 5.3-rc-alpine3.21, rc-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: f487bffdced60fba425283c84317e6492488a252
+GitCommit: 712b1f0c63d45c37d1072e6e9e635da1edfb0734
Directory: 5.3-rc
-Tags: devel-20241126, devel, devel-20241126-alpine3.20, devel-alpine3.20
+Tags: devel-20241126, devel, devel-20241126-alpine3.21, devel-alpine3.21
Architectures: amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, riscv64, s390x
-GitCommit: 81712e450fb2dc6ef3683919519b6078492ab653
+GitCommit: 4811b83a9b81e2af6587fbe01c7932a078cb1acc
Directory: devel
diff --git a/_bashbrew-list b/_bashbrew-list
index 5bf9dd1..e3f9e8c 100644
--- a/_bashbrew-list
+++ b/_bashbrew-list
@@ -1,62 +1,62 @@
bash:3
-bash:3-alpine3.20
+bash:3-alpine3.21
bash:3.0
-bash:3.0-alpine3.20
+bash:3.0-alpine3.21
bash:3.0.22
-bash:3.0.22-alpine3.20
+bash:3.0.22-alpine3.21
bash:3.1
-bash:3.1-alpine3.20
+bash:3.1-alpine3.21
bash:3.1.23
-bash:3.1.23-alpine3.20
+bash:3.1.23-alpine3.21
bash:3.2
-bash:3.2-alpine3.20
+bash:3.2-alpine3.21
bash:3.2.57
-bash:3.2.57-alpine3.20
+bash:3.2.57-alpine3.21
bash:4
-bash:4-alpine3.20
+bash:4-alpine3.21
bash:4.0
-bash:4.0-alpine3.20
+bash:4.0-alpine3.21
bash:4.0.44
-bash:4.0.44-alpine3.20
+bash:4.0.44-alpine3.21
bash:4.1
-bash:4.1-alpine3.20
+bash:4.1-alpine3.21
bash:4.1.17
-bash:4.1.17-alpine3.20
+bash:4.1.17-alpine3.21
bash:4.2
-bash:4.2-alpine3.20
+bash:4.2-alpine3.21
bash:4.2.53
-bash:4.2.53-alpine3.20
+bash:4.2.53-alpine3.21
bash:4.3
-bash:4.3-alpine3.20
+bash:4.3-alpine3.21
bash:4.3.48
-bash:4.3.48-alpine3.20
+bash:4.3.48-alpine3.21
bash:4.4
-bash:4.4-alpine3.20
+bash:4.4-alpine3.21
bash:4.4.23
-bash:4.4.23-alpine3.20
+bash:4.4.23-alpine3.21
bash:5
-bash:5-alpine3.20
+bash:5-alpine3.21
bash:5.0
-bash:5.0-alpine3.20
+bash:5.0-alpine3.21
bash:5.0.18
-bash:5.0.18-alpine3.20
+bash:5.0.18-alpine3.21
bash:5.1
-bash:5.1-alpine3.20
+bash:5.1-alpine3.21
bash:5.1.16
-bash:5.1.16-alpine3.20
+bash:5.1.16-alpine3.21
bash:5.2
-bash:5.2-alpine3.20
+bash:5.2-alpine3.21
bash:5.2.37
-bash:5.2.37-alpine3.20
+bash:5.2.37-alpine3.21
bash:5.3-alpha
-bash:5.3-alpha-alpine3.20
+bash:5.3-alpha-alpine3.21
bash:5.3-rc
-bash:5.3-rc-alpine3.20
-bash:alpine3.20
+bash:5.3-rc-alpine3.21
+bash:alpine3.21
bash:devel
bash:devel-20241126
-bash:devel-20241126-alpine3.20
-bash:devel-alpine3.20
+bash:devel-20241126-alpine3.21
+bash:devel-alpine3.21
bash:latest
bash:rc
-bash:rc-alpine3.20
+bash:rc-alpine3.21
diff --git a/_bashbrew-list-build-order b/_bashbrew-list-build-order
index e29f040..daae838 100644
--- a/_bashbrew-list-build-order
+++ b/_bashbrew-list-build-order
@@ -1,13 +1,13 @@
-bash:3-alpine3.20
-bash:3.0-alpine3.20
-bash:3.1-alpine3.20
-bash:4-alpine3.20
-bash:4.0-alpine3.20
-bash:4.1-alpine3.20
-bash:4.2-alpine3.20
-bash:4.3-alpine3.20
-bash:5.0-alpine3.20
-bash:5.1-alpine3.20
-bash:alpine3.20
-bash:devel-alpine3.20
-bash:rc-alpine3.20
+bash:3-alpine3.21
+bash:3.0-alpine3.21
+bash:3.1-alpine3.21
+bash:4-alpine3.21
+bash:4.0-alpine3.21
+bash:4.1-alpine3.21
+bash:4.2-alpine3.21
+bash:4.3-alpine3.21
+bash:5.0-alpine3.21
+bash:5.1-alpine3.21
+bash:alpine3.21
+bash:devel-alpine3.21
+bash:rc-alpine3.21
diff --git a/bash_3-alpine3.20/Dockerfile b/bash_3-alpine3.21/Dockerfile
similarity index 90%
rename from bash_3-alpine3.20/Dockerfile
rename to bash_3-alpine3.21/Dockerfile
index baf48ca..9bf2050 100644
--- a/bash_3-alpine3.20/Dockerfile
+++ b/bash_3-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 3.2.57
@@ -14,6 +14,8 @@ ENV _BASH_BASELINE_PATCH 57
ENV _BASH_LATEST_PATCH 57
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -61,12 +63,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +76,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +86,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -106,7 +116,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_3-alpine3.21/alpine3.21.patch b/bash_3-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..f59c4a3
--- /dev/null
+++ b/bash_3-alpine3.21/alpine3.21.patch
@@ -0,0 +1,161 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/lib/glob/glob.c b/lib/glob/glob.c
+index 08a7da85..915bac3f 100644
+--- a/lib/glob/glob.c
++++ b/lib/glob/glob.c
+@@ -45,6 +45,7 @@
+
+ #include "stdc.h"
+ #include "memalloc.h"
++#include "sig.h" // needed by "quit.h"
+ #include "quit.h"
+
+ #include "glob.h"
+
+diff --git a/lib/glob/strmatch.c b/lib/glob/strmatch.c
+index 4d9c68d0..cea9bd86 100644
+--- a/lib/glob/strmatch.c
++++ b/lib/glob/strmatch.c
+@@ -25,7 +25,7 @@
+ #include "strmatch.h"
+
+ extern int xstrmatch __P((char *, char *, int));
+-#if defined (HAVE_MULTIBYTE)
++#if defined (HANDLE_MULTIBYTE)
+ extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
+ #endif
+
+
+diff --git a/nojobs.c b/nojobs.c
+index a3d51f67..7303f07f 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -45,6 +45,7 @@
+
+ #include "shell.h"
+ #include "jobs.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -398,6 +399,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -838,6 +840,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -869,10 +872,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -60,6 +60,12 @@ extern int executing_list;
+ extern int comsub_ignore_return;
+ extern int parse_and_execute_level, shell_initialized;
+
++extern void initialize_siglist ();
++
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile int interrupt_state = 0;
+
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
+
+diff --git a/subst.c b/subst.c
+index 089457fb..2e24ac4e 100644
+--- a/subst.c
++++ b/subst.c
+@@ -2625,6 +2625,7 @@ expand_assignment_string_to_string (string, quoted)
+ char *
+ expand_arith_string (string, quoted)
+ char *string;
++ int quoted;
+ {
+ return (expand_string_if_necessary (string, quoted, expand_string));
+ }
+
+diff --git a/support/bashversion.c b/support/bashversion.c
+index abf1aa8d..59c2321e 100644
+--- a/support/bashversion.c
++++ b/support/bashversion.c
+@@ -47,6 +47,9 @@ extern char *optarg;
+ extern char *dist_version;
+ extern int patch_level;
+
++extern char *shell_version_string __P((void));
++extern void show_shell_version __P((int));
++
+ char *shell_name = "bash";
+ char *progname;
+
diff --git a/bash_3-alpine3.20/docker-entrypoint.sh b/bash_3-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_3-alpine3.20/docker-entrypoint.sh
rename to bash_3-alpine3.21/docker-entrypoint.sh
diff --git a/bash_3.0-alpine3.20/Dockerfile b/bash_3.0-alpine3.21/Dockerfile
similarity index 90%
rename from bash_3.0-alpine3.20/Dockerfile
rename to bash_3.0-alpine3.21/Dockerfile
index 1a1b2ab..55a3ceb 100644
--- a/bash_3.0-alpine3.20/Dockerfile
+++ b/bash_3.0-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 3.0.22
@@ -14,6 +14,8 @@ ENV _BASH_BASELINE_PATCH 16
ENV _BASH_LATEST_PATCH 22
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -61,12 +63,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +76,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +86,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -106,7 +116,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_3.0-alpine3.21/alpine3.21.patch b/bash_3.0-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..da3f14f
--- /dev/null
+++ b/bash_3.0-alpine3.21/alpine3.21.patch
@@ -0,0 +1,226 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/builtins/evalfile.c b/builtins/evalfile.c
+index c17e547b..81be017b 100644
+--- a/builtins/evalfile.c
++++ b/builtins/evalfile.c
+@@ -39,6 +39,7 @@
+ #include "../flags.h"
+ #include "../input.h"
+ #include "../execute_cmd.h"
++#include "../trap.h"
+
+ #if defined (HISTORY)
+ # include "../bashhist.h"
+
+diff --git a/externs.h b/externs.h
+index a015d782..c745c2aa 100644
+--- a/externs.h
++++ b/externs.h
+@@ -362,6 +362,9 @@ extern int sh_mktmpfd __P((char *, int, char **));
+ #undef xstrchr
+ extern char *xstrchr __P((const char *, int));
+
++/* declarations for functions defined in lib/sh/zcatfd.c */
++extern int zcatfd __P((int, int, char *));
++
+ /* declarations for functions defined in lib/sh/zread.c */
+ extern ssize_t zread __P((int, char *, size_t));
+ extern ssize_t zreadintr __P((int, char *, size_t));
+
+diff --git a/general.c b/general.c
+index 0b9c8fb6..3384e84b 100644
+--- a/general.c
++++ b/general.c
+@@ -39,6 +39,8 @@
+ #include "bashintl.h"
+
+ #include "shell.h"
++#include "test.h"
++
+ #include <tilde/tilde.h>
+
+ #if !defined (errno)
+
+diff --git a/lib/glob/strmatch.c b/lib/glob/strmatch.c
+index 4d9c68d0..cea9bd86 100644
+--- a/lib/glob/strmatch.c
++++ b/lib/glob/strmatch.c
+@@ -25,7 +25,7 @@
+ #include "strmatch.h"
+
+ extern int xstrmatch __P((char *, char *, int));
+-#if defined (HAVE_MULTIBYTE)
++#if defined (HANDLE_MULTIBYTE)
+ extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
+ #endif
+
+
+diff --git a/lib/intl/Makefile.in b/lib/intl/Makefile.in
+index 70bafc9c..8520ed2e 100644
+--- a/lib/intl/Makefile.in
++++ b/lib/intl/Makefile.in
+@@ -51,12 +51,14 @@ RANLIB = @RANLIB@
+ YACC = @INTLBISON@ -y -d
+ YFLAGS = --name-prefix=__gettext
+
++LOCAL_DEFS = @LOCAL_DEFS@
++
+ DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
+ -DLIBDIR=\"$(prefix)/libdata\" -DIN_LIBINTL \
+ -DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
+ -Dset_relocation_prefix=libintl_set_relocation_prefix \
+ -Drelocate=libintl_relocate \
+--DDEPENDS_ON_LIBICONV=1 @DEFS@
++-DDEPENDS_ON_LIBICONV=1 @DEFS@ @LOCAL_DEFS@
+ CPPFLAGS = @CPPFLAGS@
+ CFLAGS = @CFLAGS@
+ LDFLAGS = @LDFLAGS@
+
+diff --git a/lib/intl/dcigettext.c b/lib/intl/dcigettext.c
+index f6edb95c..c7e696a8 100644
+--- a/lib/intl/dcigettext.c
++++ b/lib/intl/dcigettext.c
+@@ -134,6 +134,10 @@ extern int errno;
+
+ /* @@ end of prolog @@ */
+
++#if defined (SHELL) && !defined (HAVE_GETCWD)
++# define HAVE_GETCWD
++#endif
++
+ #ifdef _LIBC
+ /* Rename the non ANSI C functions. This is required by the standard
+ because some ANSI C functions will require linking with this object
+
+diff --git a/make_cmd.c b/make_cmd.c
+index 479d9c3e..df200105 100644
+--- a/make_cmd.c
++++ b/make_cmd.c
+@@ -355,6 +359,7 @@ COMMAND *
+ make_case_command (word, clauses, lineno)
+ WORD_DESC *word;
+ PATTERN_LIST *clauses;
++ int lineno;
+ {
+ CASE_COM *temp;
+
+diff --git a/nojobs.c b/nojobs.c
+index a3d51f67..7303f07f 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -45,6 +45,7 @@
+
+ #include "shell.h"
+ #include "jobs.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -398,6 +399,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -838,6 +840,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -869,10 +872,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -60,6 +60,12 @@ extern int executing_list;
+ extern int comsub_ignore_return;
+ extern int parse_and_execute_level, shell_initialized;
+
++extern void initialize_siglist ();
++
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile int interrupt_state = 0;
+
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
+
+diff --git a/support/bashversion.c b/support/bashversion.c
+index abf1aa8d..59c2321e 100644
+--- a/support/bashversion.c
++++ b/support/bashversion.c
+@@ -47,6 +47,9 @@ extern char *optarg;
+ extern char *dist_version;
+ extern int patch_level;
+
++extern char *shell_version_string __P((void));
++extern void show_shell_version __P((int));
++
+ char *shell_name = "bash";
+ char *progname;
+
diff --git a/bash_3.0-alpine3.20/docker-entrypoint.sh b/bash_3.0-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_3.0-alpine3.20/docker-entrypoint.sh
rename to bash_3.0-alpine3.21/docker-entrypoint.sh
diff --git a/bash_3.1-alpine3.20/Dockerfile b/bash_3.1-alpine3.21/Dockerfile
similarity index 90%
rename from bash_3.1-alpine3.20/Dockerfile
rename to bash_3.1-alpine3.21/Dockerfile
index ff63401..60b2daa 100644
--- a/bash_3.1-alpine3.20/Dockerfile
+++ b/bash_3.1-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 3.1.23
@@ -13,6 +13,8 @@ ENV _BASH_BASELINE 3.1
ENV _BASH_LATEST_PATCH 23
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -60,12 +62,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -73,7 +75,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -83,7 +85,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -105,7 +115,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_3.1-alpine3.21/alpine3.21.patch b/bash_3.1-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..77c947d
--- /dev/null
+++ b/bash_3.1-alpine3.21/alpine3.21.patch
@@ -0,0 +1,202 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/builtins/echo.def b/builtins/echo.def
+index 6792659a..923c43a2 100644
+--- a/builtins/echo.def
++++ b/builtins/echo.def
+@@ -31,6 +31,8 @@ $PRODUCES echo.c
+ #include <stdio.h>
+ #include "../shell.h"
+
++#include "common.h"
++
+ $BUILTIN echo
+ $FUNCTION echo_builtin
+ $DEPENDS_ON V9_ECHO
+
+diff --git a/builtins/printf.def b/builtins/printf.def
+index b4a528fe..c8c0c633 100644
+--- a/builtins/printf.def
++++ b/builtins/printf.def
+@@ -588,7 +588,7 @@ printstr (fmt, string, len, fieldwidth, precision)
+ #else
+ if (string == 0 || len == 0)
+ #endif
+- return;
++ return 0;
+
+ #if 0
+ s = fmt;
+
+diff --git a/lib/glob/strmatch.c b/lib/glob/strmatch.c
+index 4d9c68d0..cea9bd86 100644
+--- a/lib/glob/strmatch.c
++++ b/lib/glob/strmatch.c
+@@ -25,7 +25,7 @@
+ #include "strmatch.h"
+
+ extern int xstrmatch __P((char *, char *, int));
+-#if defined (HAVE_MULTIBYTE)
++#if defined (HANDLE_MULTIBYTE)
+ extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
+ #endif
+
+
+diff --git a/lib/readline/callback.c b/lib/readline/callback.c
+index 9120969c..ada04d85 100644
+--- a/lib/readline/callback.c
++++ b/lib/readline/callback.c
+@@ -43,6 +43,7 @@
+ #include "rldefs.h"
+ #include "readline.h"
+ #include "rlprivate.h"
++#include "xmalloc.h"
+
+ /* Private data for callback registration functions. See comments in
+ rl_callback_read_char for more details. */
+
+diff --git a/lib/sh/winsize.c b/lib/sh/winsize.c
+index 8b39c99e..f4696de0 100644
+--- a/lib/sh/winsize.c
++++ b/lib/sh/winsize.c
+@@ -55,6 +55,7 @@ extern int shell_tty;
+ #if defined (READLINE)
+ extern void rl_set_screen_size __P((int, int));
+ #endif
++extern void sh_set_lines_and_columns __P((int, int));
+
+ void
+ get_new_window_size (from_sig, rp, cp)
+
+diff --git a/nojobs.c b/nojobs.c
+index a3d51f67..7303f07f 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -45,6 +45,7 @@
+
+ #include "shell.h"
+ #include "jobs.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -398,6 +399,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -838,6 +840,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -869,10 +872,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -60,6 +60,12 @@ extern int executing_list;
+ extern int comsub_ignore_return;
+ extern int parse_and_execute_level, shell_initialized;
+
++extern void initialize_siglist ();
++
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile int interrupt_state = 0;
+
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
+
+diff --git a/subst.c b/subst.c
+index 089457fb..2e24ac4e 100644
+--- a/subst.c
++++ b/subst.c
+@@ -2625,6 +2625,7 @@ expand_assignment_string_to_string (string, quoted)
+ char *
+ expand_arith_string (string, quoted)
+ char *string;
++ int quoted;
+ {
+ return (expand_string_if_necessary (string, quoted, expand_string));
+ }
+
+diff --git a/support/bashversion.c b/support/bashversion.c
+index abf1aa8d..59c2321e 100644
+--- a/support/bashversion.c
++++ b/support/bashversion.c
+@@ -47,6 +47,9 @@ extern char *optarg;
+ extern char *dist_version;
+ extern int patch_level;
+
++extern char *shell_version_string __P((void));
++extern void show_shell_version __P((int));
++
+ char *shell_name = "bash";
+ char *progname;
+
diff --git a/bash_3.1-alpine3.20/docker-entrypoint.sh b/bash_3.1-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_3.1-alpine3.20/docker-entrypoint.sh
rename to bash_3.1-alpine3.21/docker-entrypoint.sh
diff --git a/bash_4-alpine3.20/Dockerfile b/bash_4-alpine3.21/Dockerfile
similarity index 90%
rename from bash_4-alpine3.20/Dockerfile
rename to bash_4-alpine3.21/Dockerfile
index 4bcd61e..689d2a4 100644
--- a/bash_4-alpine3.20/Dockerfile
+++ b/bash_4-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 4.4.23
@@ -14,6 +14,8 @@ ENV _BASH_BASELINE_PATCH 18
ENV _BASH_LATEST_PATCH 23
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -61,12 +63,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +76,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +86,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -104,7 +114,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_4-alpine3.21/alpine3.21.patch b/bash_4-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..cad9359
--- /dev/null
+++ b/bash_4-alpine3.21/alpine3.21.patch
@@ -0,0 +1,28 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/parse.y b/parse.y
+index f415d2ee..e59dbed9 100644
+--- a/parse.y
++++ b/parse.y
+@@ -71,6 +71,7 @@
+ # include "jobs.h"
+ #else
+ extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
diff --git a/bash_4-alpine3.20/docker-entrypoint.sh b/bash_4-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_4-alpine3.20/docker-entrypoint.sh
rename to bash_4-alpine3.21/docker-entrypoint.sh
diff --git a/bash_4.0-alpine3.20/Dockerfile b/bash_4.0-alpine3.21/Dockerfile
similarity index 91%
rename from bash_4.0-alpine3.20/Dockerfile
rename to bash_4.0-alpine3.21/Dockerfile
index d912ce8..ba5f1f6 100644
--- a/bash_4.0-alpine3.20/Dockerfile
+++ b/bash_4.0-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 4.0.44
@@ -13,6 +13,8 @@ ENV _BASH_BASELINE 4.0
ENV _BASH_LATEST_PATCH 44
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -60,12 +62,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -73,7 +75,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -83,7 +85,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -108,7 +118,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_4.0-alpine3.21/alpine3.21.patch b/bash_4.0-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..0b87cae
--- /dev/null
+++ b/bash_4.0-alpine3.21/alpine3.21.patch
@@ -0,0 +1,152 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/execute_cmd.c b/execute_cmd.c
+index 4ee59c11..2a3df6d6 100644
+--- a/execute_cmd.c
++++ b/execute_cmd.c
+@@ -57,6 +57,8 @@
+ extern int errno;
+ #endif
+
++#define NEED_FPURGE_DECL
++
+ #include "bashansi.h"
+ #include "bashintl.h"
+
+@@ -2061,6 +2120,7 @@ coproc_fdrestore (cp)
+ void
+ coproc_pidchk (pid, status)
+ pid_t pid;
++ int status;
+ {
+ struct coproc *cp;
+
+diff --git a/lib/readline/signals.c b/lib/readline/signals.c
+index 4fbc019e..6a68d78c 100644
+--- a/lib/readline/signals.c
++++ b/lib/readline/signals.c
+@@ -131,6 +131,7 @@ static sighandler_cxt old_winch;
+ /* Called from RL_CHECK_SIGNALS() macro */
+ RETSIGTYPE
+ _rl_signal_handler (sig)
++ int sig;
+ {
+ _rl_caught_signal = 0; /* XXX */
+
+
+diff --git a/nojobs.c b/nojobs.c
+index 0c9bd751..fdbe0ae0 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -46,6 +46,7 @@
+ #include "shell.h"
+ #include "jobs.h"
+ #include "execute_cmd.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -410,6 +419,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -879,6 +933,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -910,10 +966,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -60,6 +60,12 @@ extern int executing_list;
+ extern int comsub_ignore_return;
+ extern int parse_and_execute_level, shell_initialized;
+
++extern void initialize_siglist ();
++
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile int interrupt_state = 0;
+
+diff --git a/siglist.c b/siglist.c
+index 27eb26a4..0e51b836 100644
+--- a/siglist.c
++++ b/siglist.c
+@@ -32,6 +32,7 @@
+ # include "trap.h"
+ #endif
+
++#include "bashintl.h"
+ #include "xmalloc.h"
+
+ char *sys_siglist[NSIG];
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
diff --git a/bash_4.0-alpine3.20/docker-entrypoint.sh b/bash_4.0-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_4.0-alpine3.20/docker-entrypoint.sh
rename to bash_4.0-alpine3.21/docker-entrypoint.sh
diff --git a/bash_4.1-alpine3.20/Dockerfile b/bash_4.1-alpine3.21/Dockerfile
similarity index 90%
rename from bash_4.1-alpine3.20/Dockerfile
rename to bash_4.1-alpine3.21/Dockerfile
index a46f521..071b2c1 100644
--- a/bash_4.1-alpine3.20/Dockerfile
+++ b/bash_4.1-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 4.1.17
@@ -13,6 +13,8 @@ ENV _BASH_BASELINE 4.1
ENV _BASH_LATEST_PATCH 17
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -60,12 +62,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -73,7 +75,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -83,7 +85,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -103,7 +113,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_4.1-alpine3.21/alpine3.21.patch b/bash_4.1-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..dfaec46
--- /dev/null
+++ b/bash_4.1-alpine3.21/alpine3.21.patch
@@ -0,0 +1,130 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/execute_cmd.c b/execute_cmd.c
+index 4ee59c11..2a3df6d6 100644
+--- a/execute_cmd.c
++++ b/execute_cmd.c
+@@ -2061,6 +2120,7 @@ coproc_fdrestore (cp)
+ void
+ coproc_pidchk (pid, status)
+ pid_t pid;
++ int status;
+ {
+ struct coproc *cp;
+
+diff --git a/lib/readline/signals.c b/lib/readline/signals.c
+index 4fbc019e..6a68d78c 100644
+--- a/lib/readline/signals.c
++++ b/lib/readline/signals.c
+@@ -131,6 +131,7 @@ static sighandler_cxt old_winch;
+ /* Called from RL_CHECK_SIGNALS() macro */
+ RETSIGTYPE
+ _rl_signal_handler (sig)
++ int sig;
+ {
+ _rl_caught_signal = 0; /* XXX */
+
+
+diff --git a/nojobs.c b/nojobs.c
+index 0c9bd751..fdbe0ae0 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -46,6 +46,7 @@
+ #include "shell.h"
+ #include "jobs.h"
+ #include "execute_cmd.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -410,6 +419,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -879,6 +933,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -910,10 +966,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -60,6 +60,12 @@ extern int executing_list;
+ extern int comsub_ignore_return;
+ extern int parse_and_execute_level, shell_initialized;
+
++extern void initialize_siglist ();
++
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile int interrupt_state = 0;
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
diff --git a/bash_4.1-alpine3.20/docker-entrypoint.sh b/bash_4.1-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_4.1-alpine3.20/docker-entrypoint.sh
rename to bash_4.1-alpine3.21/docker-entrypoint.sh
diff --git a/bash_4.2-alpine3.20/Dockerfile b/bash_4.2-alpine3.21/Dockerfile
similarity index 90%
rename from bash_4.2-alpine3.20/Dockerfile
rename to bash_4.2-alpine3.21/Dockerfile
index 2372407..b4ce0d6 100644
--- a/bash_4.2-alpine3.20/Dockerfile
+++ b/bash_4.2-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 4.2.53
@@ -14,6 +14,8 @@ ENV _BASH_BASELINE_PATCH 53
ENV _BASH_LATEST_PATCH 53
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -61,12 +63,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +76,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +86,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -104,7 +114,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_4.2-alpine3.21/alpine3.21.patch b/bash_4.2-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..ba9fd8a
--- /dev/null
+++ b/bash_4.2-alpine3.21/alpine3.21.patch
@@ -0,0 +1,115 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/execute_cmd.c b/execute_cmd.c
+index 4ee59c11..2a3df6d6 100644
+--- a/execute_cmd.c
++++ b/execute_cmd.c
+@@ -2061,6 +2120,7 @@ coproc_fdrestore (cp)
+ void
+ coproc_pidchk (pid, status)
+ pid_t pid;
++ int status;
+ {
+ struct coproc *cp;
+
+diff --git a/nojobs.c b/nojobs.c
+index 0c9bd751..fdbe0ae0 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -46,6 +46,7 @@
+ #include "shell.h"
+ #include "jobs.h"
+ #include "execute_cmd.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -410,6 +419,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -879,6 +933,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -910,10 +966,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -70,6 +70,10 @@ extern sh_builtin_func_t *this_shell_builtin;
+
+ extern void initialize_siglist ();
+
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile sig_atomic_t interrupt_state = 0;
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
diff --git a/bash_4.2-alpine3.20/docker-entrypoint.sh b/bash_4.2-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_4.2-alpine3.20/docker-entrypoint.sh
rename to bash_4.2-alpine3.21/docker-entrypoint.sh
diff --git a/bash_4.3-alpine3.20/Dockerfile b/bash_4.3-alpine3.21/Dockerfile
similarity index 90%
rename from bash_4.3-alpine3.20/Dockerfile
rename to bash_4.3-alpine3.21/Dockerfile
index 29c941e..aa1bcda 100644
--- a/bash_4.3-alpine3.20/Dockerfile
+++ b/bash_4.3-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 4.3.48
@@ -14,6 +14,8 @@ ENV _BASH_BASELINE_PATCH 30
ENV _BASH_LATEST_PATCH 48
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -61,12 +63,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +76,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +86,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
# update "config.guess" and "config.sub" to get more aggressively inclusive architecture support
for f in config.guess config.sub; do \
@@ -104,7 +114,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_4.3-alpine3.21/alpine3.21.patch b/bash_4.3-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..5d79617
--- /dev/null
+++ b/bash_4.3-alpine3.21/alpine3.21.patch
@@ -0,0 +1,141 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon (& Chet, for fixes borrowed/backported)
+
+diff --git a/execute_cmd.c b/execute_cmd.c
+index 4ee59c11..2a3df6d6 100644
+--- a/execute_cmd.c
++++ b/execute_cmd.c
+@@ -2061,6 +2120,7 @@ coproc_fdrestore (cp)
+ void
+ coproc_pidchk (pid, status)
+ pid_t pid;
++ int status;
+ {
+ struct coproc *cp;
+
+diff --git a/nojobs.c b/nojobs.c
+index 0c9bd751..fdbe0ae0 100644
+--- a/nojobs.c
++++ b/nojobs.c
+@@ -46,6 +46,7 @@
+ #include "shell.h"
+ #include "jobs.h"
+ #include "execute_cmd.h"
++#include "trap.h"
+
+ #include "builtins/builtext.h" /* for wait_builtin */
+
+@@ -410,6 +419,7 @@ reap_dead_jobs ()
+ }
+
+ /* Initialize the job control mechanism, and set up the tty stuff. */
++int
+ initialize_job_control (force)
+ int force;
+ {
+@@ -879,6 +933,7 @@ static TTYSTRUCT shell_tty_info;
+ static int got_tty_state;
+
+ /* Fill the contents of shell_tty_info with the current tty info. */
++int
+ get_tty_state ()
+ {
+ int tty;
+@@ -910,10 +966,12 @@ set_tty_state ()
+ }
+
+ /* Give the terminal to PGRP. */
++int
+ give_terminal_to (pgrp, force)
+ pid_t pgrp;
+ int force;
+ {
++ return 0;
+ }
+
+ /* Stop a pipeline. */
+
+diff --git a/parse.y b/parse.y
+index 5211fbcb..f0cdfbf4 100644
+--- a/parse.y
++++ b/parse.y
+@@ -69,6 +69,9 @@
+
+ #if defined (JOB_CONTROL)
+ # include "jobs.h"
++#else
++extern int cleanup_dead_jobs __P((void));
++extern int count_all_jobs __P((void));
+ #endif /* JOB_CONTROL */
+
+ #if defined (ALIAS)
+
+diff --git a/redir.c b/redir.c
+index e514976d..25488eaf 100644
+--- a/redir.c
++++ b/redir.c
+@@ -52,6 +52,7 @@ extern int errno;
+ #include "flags.h"
+ #include "execute_cmd.h"
+ #include "redir.h"
++#include "trap.h"
+
+ #if defined (BUFFERED_INPUT)
+ # include "input.h"
+
+diff --git a/shell.c b/shell.c
+index 2fd8179b..45b77f9e 100644
+--- a/shell.c
++++ b/shell.c
+@@ -57,6 +59,9 @@
+
+ #if defined (JOB_CONTROL)
+ #include "jobs.h"
++#else
++extern int initialize_job_control __P((int));
++extern int get_tty_state __P((void));
+ #endif /* JOB_CONTROL */
+
+ #include "input.h"
+
+diff --git a/sig.c b/sig.c
+index 8bc45c17..d31ca87b 100644
+--- a/sig.c
++++ b/sig.c
+@@ -70,6 +70,10 @@ extern sh_builtin_func_t *this_shell_builtin;
+
+ extern void initialize_siglist ();
+
++#if !defined (JOB_CONTROL)
++extern void initialize_job_signals __P((void));
++#endif
++
+ /* Non-zero after SIGINT. */
+ volatile sig_atomic_t interrupt_state = 0;
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
+
+diff --git a/variables.c b/variables.c
+index 51aaf9cd..0ec7b5d6 100644
+--- a/variables.c
++++ b/variables.c
+@@ -2573,7 +2573,7 @@ bind_variable_internal (name, value, table, hflags, aflags)
+ entry = make_new_array_variable (newname); /* indexed array by default */
+ if (entry == 0)
+ return entry;
+- ind = array_expand_index (name, subp, sublen);
++ ind = array_expand_index (entry, subp, sublen);
+ bind_array_element (entry, ind, value, aflags);
+ }
+ #endif
diff --git a/bash_4.3-alpine3.20/docker-entrypoint.sh b/bash_4.3-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_4.3-alpine3.20/docker-entrypoint.sh
rename to bash_4.3-alpine3.21/docker-entrypoint.sh
diff --git a/bash_5.0-alpine3.20/Dockerfile b/bash_5.0-alpine3.21/Dockerfile
similarity index 89%
rename from bash_5.0-alpine3.20/Dockerfile
rename to bash_5.0-alpine3.21/Dockerfile
index 848f99b..1a42ed9 100644
--- a/bash_5.0-alpine3.20/Dockerfile
+++ b/bash_5.0-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 5.0.18
@@ -13,6 +13,8 @@ ENV _BASH_BASELINE 5.0
ENV _BASH_LATEST_PATCH 18
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine3.21.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -60,12 +62,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -73,7 +75,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -83,7 +85,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
+ \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--build="$gnuArch" \
@@ -99,7 +109,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_5.0-alpine3.21/alpine3.21.patch b/bash_5.0-alpine3.21/alpine3.21.patch
new file mode 100644
index 0000000..cfd7dd4
--- /dev/null
+++ b/bash_5.0-alpine3.21/alpine3.21.patch
@@ -0,0 +1,15 @@
+Description: minor fixes for Alpine 3.21+
+Author: Tianon
+
+diff --git a/siglist.h b/siglist.h
+index 4cb65308..bc0ea441 100644
+--- a/siglist.h
++++ b/siglist.h
+@@ -18,6 +18,8 @@
+ along with Bash. If not, see <http://www.gnu.org/licenses/>.
+ */
+
++#include <string.h>
++
+ #if !defined (_SIGLIST_H_)
+ #define _SIGLIST_H_
diff --git a/bash_5.0-alpine3.20/docker-entrypoint.sh b/bash_5.0-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_5.0-alpine3.20/docker-entrypoint.sh
rename to bash_5.0-alpine3.21/docker-entrypoint.sh
diff --git a/bash_5.1-alpine3.20/Dockerfile b/bash_5.1-alpine3.21/Dockerfile
similarity index 94%
rename from bash_5.1-alpine3.20/Dockerfile
rename to bash_5.1-alpine3.21/Dockerfile
index d15f651..a29f67d 100644
--- a/bash_5.1-alpine3.20/Dockerfile
+++ b/bash_5.1-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 5.1.16
@@ -61,12 +61,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +74,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +84,7 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--build="$gnuArch" \
@@ -100,7 +100,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_5.1-alpine3.20/docker-entrypoint.sh b/bash_5.1-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_5.1-alpine3.20/docker-entrypoint.sh
rename to bash_5.1-alpine3.21/docker-entrypoint.sh
diff --git a/bash_alpine3.20/Dockerfile b/bash_alpine3.21/Dockerfile
similarity index 94%
rename from bash_alpine3.20/Dockerfile
rename to bash_alpine3.21/Dockerfile
index 3d37839..d66e047 100644
--- a/bash_alpine3.20/Dockerfile
+++ b/bash_alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 5.2.37
@@ -61,12 +61,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -74,7 +74,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -84,7 +84,7 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--build="$gnuArch" \
@@ -100,7 +100,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_alpine3.20/docker-entrypoint.sh b/bash_alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_alpine3.20/docker-entrypoint.sh
rename to bash_alpine3.21/docker-entrypoint.sh
diff --git a/bash_devel-alpine3.20/Dockerfile b/bash_devel-alpine3.21/Dockerfile
similarity index 84%
rename from bash_devel-alpine3.20/Dockerfile
rename to bash_devel-alpine3.21/Dockerfile
index 86c02ac..024f646 100644
--- a/bash_devel-alpine3.20/Dockerfile
+++ b/bash_devel-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://git.savannah.gnu.org/cgit/bash.git/log/?h=devel
ENV _BASH_COMMIT 49c2670226b045746d66765b23af37c1c7ba5597
@@ -12,6 +12,8 @@ ENV _BASH_COMMIT 49c2670226b045746d66765b23af37c1c7ba5597
ENV _BASH_VERSION devel-20241126
# prefixed with "_" since "$BASH..." have meaning in Bash parlance
+COPY alpine-strcpy.patch /usr/local/src/tianon-bash-patches/
+
RUN set -eux; \
\
apk add --no-cache --virtual .build-deps \
@@ -28,12 +30,12 @@ RUN set -eux; \
\
wget -O bash.tar.gz "https://git.savannah.gnu.org/cgit/bash.git/snapshot/bash-$_BASH_COMMIT.tar.gz"; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -41,7 +43,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -51,11 +53,15 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
-# https://lists.gnu.org/archive/html/bug-bash/2023-05/msg00011.html
- { echo '#include <unistd.h>'; echo; cat /usr/src/bash/lib/sh/strscpy.c; } > /usr/src/bash/lib/sh/strscpy.c.new; \
- mv /usr/src/bash/lib/sh/strscpy.c.new /usr/src/bash/lib/sh/strscpy.c; \
+ for p in /usr/local/src/tianon-bash-patches/*; do \
+ patch \
+ --directory=/usr/local/src/bash \
+ --input="$p" \
+ --strip=1 \
+ ; \
+ done; \
\
- cd /usr/src/bash; \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--build="$gnuArch" \
@@ -71,7 +77,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_devel-alpine3.21/alpine-strcpy.patch b/bash_devel-alpine3.21/alpine-strcpy.patch
new file mode 100644
index 0000000..0431757
--- /dev/null
+++ b/bash_devel-alpine3.21/alpine-strcpy.patch
@@ -0,0 +1,17 @@
+Description: fix Alpine ssize_t vs size_t bug
+Author: Emanuele Torre
+Origin: https://lists.gnu.org/archive/html/bug-bash/2023-05/msg00011.html
+
+diff --git a/lib/sh/strscpy.c b/lib/sh/strscpy.c
+index 7a948ebe..e2679e95 100644
+--- a/lib/sh/strscpy.c
++++ b/lib/sh/strscpy.c
+@@ -22,6 +22,8 @@
+
+ #include <bashansi.h>
+
++#include <unistd.h>
++
+ ssize_t
+ strscpy (char *d, const char *s, size_t len)
+ {
diff --git a/bash_devel-alpine3.20/docker-entrypoint.sh b/bash_devel-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_devel-alpine3.20/docker-entrypoint.sh
rename to bash_devel-alpine3.21/docker-entrypoint.sh
diff --git a/bash_rc-alpine3.20/Dockerfile b/bash_rc-alpine3.21/Dockerfile
similarity index 94%
rename from bash_rc-alpine3.20/Dockerfile
rename to bash_rc-alpine3.21/Dockerfile
index 6c199b0..7a2bf3e 100644
--- a/bash_rc-alpine3.20/Dockerfile
+++ b/bash_rc-alpine3.21/Dockerfile
@@ -4,7 +4,7 @@
# PLEASE DO NOT EDIT IT DIRECTLY.
#
-FROM alpine:3.20
+FROM alpine:3.21
# https://ftp.gnu.org/gnu/bash/?C=M;O=D
ENV _BASH_VERSION 5.3-alpha
@@ -58,12 +58,12 @@ RUN set -eux; \
rm -rf "$GNUPGHOME"; \
apk del --no-network .gpg-deps; \
\
- mkdir -p /usr/src/bash; \
+ mkdir -p /usr/local/src/bash; \
tar \
--extract \
--file=bash.tar.gz \
--strip-components=1 \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
; \
rm bash.tar.gz; \
\
@@ -71,7 +71,7 @@ RUN set -eux; \
apk add --no-cache --virtual .patch-deps patch; \
for p in bash-patches/*; do \
patch \
- --directory=/usr/src/bash \
+ --directory=/usr/local/src/bash \
--input="$(readlink -f "$p")" \
--strip=0 \
; \
@@ -81,7 +81,7 @@ RUN set -eux; \
apk del --no-network .patch-deps; \
fi; \
\
- cd /usr/src/bash; \
+ cd /usr/local/src/bash; \
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
./configure \
--build="$gnuArch" \
@@ -97,7 +97,7 @@ RUN set -eux; \
make -j "$(nproc)"; \
make install; \
cd /; \
- rm -r /usr/src/bash; \
+ rm -r /usr/local/src/bash; \
\
# delete a few installed bits for smaller image size
rm -rf \
diff --git a/bash_rc-alpine3.20/docker-entrypoint.sh b/bash_rc-alpine3.21/docker-entrypoint.sh
similarity index 100%
rename from bash_rc-alpine3.20/docker-entrypoint.sh
rename to bash_rc-alpine3.21/docker-entrypoint.sh Relevant Maintainers:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a lot of changes but also reviewing tianon/docker-bash#43 and it all seems fines to me.
Changes:
/usr/local/src
tianon/docker-bash#42 from self-five/usr-local-src/usr/local/src