Skip to content

Commit 4811b83

Browse files
committed
Update all versions to Alpine 3.21
This also includes support for per-version patches, and converts some hacky code we had for devel to a proper patch file. My intent is to keep all these patches minimal -- any non-minimal patching (especially anything beyond "make it compile successfully") will likely be grounds for no longer supporting a given version. Almost all of these patches are cobbled together from later commits in Bash upstream (ie, backported fixes). Only one or two are actually pure-Tianon creations (and those are just `#include <something.h>`).
1 parent 712b1f0 commit 4811b83

23 files changed

+1319
-25
lines changed

Diff for: 3.0/Dockerfile

+11-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: 3.0/alpine3.21.patch

+226
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,226 @@
1+
Description: minor fixes for Alpine 3.21+
2+
Author: Tianon (& Chet, for fixes borrowed/backported)
3+
4+
diff --git a/builtins/evalfile.c b/builtins/evalfile.c
5+
index c17e547b..81be017b 100644
6+
--- a/builtins/evalfile.c
7+
+++ b/builtins/evalfile.c
8+
@@ -39,6 +39,7 @@
9+
#include "../flags.h"
10+
#include "../input.h"
11+
#include "../execute_cmd.h"
12+
+#include "../trap.h"
13+
14+
#if defined (HISTORY)
15+
# include "../bashhist.h"
16+
17+
diff --git a/externs.h b/externs.h
18+
index a015d782..c745c2aa 100644
19+
--- a/externs.h
20+
+++ b/externs.h
21+
@@ -362,6 +362,9 @@ extern int sh_mktmpfd __P((char *, int, char **));
22+
#undef xstrchr
23+
extern char *xstrchr __P((const char *, int));
24+
25+
+/* declarations for functions defined in lib/sh/zcatfd.c */
26+
+extern int zcatfd __P((int, int, char *));
27+
+
28+
/* declarations for functions defined in lib/sh/zread.c */
29+
extern ssize_t zread __P((int, char *, size_t));
30+
extern ssize_t zreadintr __P((int, char *, size_t));
31+
32+
diff --git a/general.c b/general.c
33+
index 0b9c8fb6..3384e84b 100644
34+
--- a/general.c
35+
+++ b/general.c
36+
@@ -39,6 +39,8 @@
37+
#include "bashintl.h"
38+
39+
#include "shell.h"
40+
+#include "test.h"
41+
+
42+
#include <tilde/tilde.h>
43+
44+
#if !defined (errno)
45+
46+
diff --git a/lib/glob/strmatch.c b/lib/glob/strmatch.c
47+
index 4d9c68d0..cea9bd86 100644
48+
--- a/lib/glob/strmatch.c
49+
+++ b/lib/glob/strmatch.c
50+
@@ -25,7 +25,7 @@
51+
#include "strmatch.h"
52+
53+
extern int xstrmatch __P((char *, char *, int));
54+
-#if defined (HAVE_MULTIBYTE)
55+
+#if defined (HANDLE_MULTIBYTE)
56+
extern int internal_wstrmatch __P((wchar_t *, wchar_t *, int));
57+
#endif
58+
59+
60+
diff --git a/lib/intl/Makefile.in b/lib/intl/Makefile.in
61+
index 70bafc9c..8520ed2e 100644
62+
--- a/lib/intl/Makefile.in
63+
+++ b/lib/intl/Makefile.in
64+
@@ -51,12 +51,14 @@ RANLIB = @RANLIB@
65+
YACC = @INTLBISON@ -y -d
66+
YFLAGS = --name-prefix=__gettext
67+
68+
+LOCAL_DEFS = @LOCAL_DEFS@
69+
+
70+
DEFS = -DLOCALEDIR=\"$(localedir)\" -DLOCALE_ALIAS_PATH=\"$(aliaspath)\" \
71+
-DLIBDIR=\"$(prefix)/libdata\" -DIN_LIBINTL \
72+
-DENABLE_RELOCATABLE=1 -DIN_LIBRARY -DINSTALLDIR=\"$(libdir)\" -DNO_XMALLOC \
73+
-Dset_relocation_prefix=libintl_set_relocation_prefix \
74+
-Drelocate=libintl_relocate \
75+
--DDEPENDS_ON_LIBICONV=1 @DEFS@
76+
+-DDEPENDS_ON_LIBICONV=1 @DEFS@ @LOCAL_DEFS@
77+
CPPFLAGS = @CPPFLAGS@
78+
CFLAGS = @CFLAGS@
79+
LDFLAGS = @LDFLAGS@
80+
81+
diff --git a/lib/intl/dcigettext.c b/lib/intl/dcigettext.c
82+
index f6edb95c..c7e696a8 100644
83+
--- a/lib/intl/dcigettext.c
84+
+++ b/lib/intl/dcigettext.c
85+
@@ -134,6 +134,10 @@ extern int errno;
86+
87+
/* @@ end of prolog @@ */
88+
89+
+#if defined (SHELL) && !defined (HAVE_GETCWD)
90+
+# define HAVE_GETCWD
91+
+#endif
92+
+
93+
#ifdef _LIBC
94+
/* Rename the non ANSI C functions. This is required by the standard
95+
because some ANSI C functions will require linking with this object
96+
97+
diff --git a/make_cmd.c b/make_cmd.c
98+
index 479d9c3e..df200105 100644
99+
--- a/make_cmd.c
100+
+++ b/make_cmd.c
101+
@@ -355,6 +359,7 @@ COMMAND *
102+
make_case_command (word, clauses, lineno)
103+
WORD_DESC *word;
104+
PATTERN_LIST *clauses;
105+
+ int lineno;
106+
{
107+
CASE_COM *temp;
108+
109+
diff --git a/nojobs.c b/nojobs.c
110+
index a3d51f67..7303f07f 100644
111+
--- a/nojobs.c
112+
+++ b/nojobs.c
113+
@@ -45,6 +45,7 @@
114+
115+
#include "shell.h"
116+
#include "jobs.h"
117+
+#include "trap.h"
118+
119+
#include "builtins/builtext.h" /* for wait_builtin */
120+
121+
@@ -398,6 +399,7 @@ reap_dead_jobs ()
122+
}
123+
124+
/* Initialize the job control mechanism, and set up the tty stuff. */
125+
+int
126+
initialize_job_control (force)
127+
int force;
128+
{
129+
@@ -838,6 +840,7 @@ static TTYSTRUCT shell_tty_info;
130+
static int got_tty_state;
131+
132+
/* Fill the contents of shell_tty_info with the current tty info. */
133+
+int
134+
get_tty_state ()
135+
{
136+
int tty;
137+
@@ -869,10 +872,12 @@ set_tty_state ()
138+
}
139+
140+
/* Give the terminal to PGRP. */
141+
+int
142+
give_terminal_to (pgrp, force)
143+
pid_t pgrp;
144+
int force;
145+
{
146+
+ return 0;
147+
}
148+
149+
/* Stop a pipeline. */
150+
151+
diff --git a/parse.y b/parse.y
152+
index 5211fbcb..f0cdfbf4 100644
153+
--- a/parse.y
154+
+++ b/parse.y
155+
@@ -69,6 +69,9 @@
156+
157+
#if defined (JOB_CONTROL)
158+
# include "jobs.h"
159+
+#else
160+
+extern int cleanup_dead_jobs __P((void));
161+
+extern int count_all_jobs __P((void));
162+
#endif /* JOB_CONTROL */
163+
164+
#if defined (ALIAS)
165+
166+
diff --git a/shell.c b/shell.c
167+
index 2fd8179b..45b77f9e 100644
168+
--- a/shell.c
169+
+++ b/shell.c
170+
@@ -57,6 +59,9 @@
171+
172+
#if defined (JOB_CONTROL)
173+
#include "jobs.h"
174+
+#else
175+
+extern int initialize_job_control __P((int));
176+
+extern int get_tty_state __P((void));
177+
#endif /* JOB_CONTROL */
178+
179+
#include "input.h"
180+
181+
diff --git a/sig.c b/sig.c
182+
index 8bc45c17..d31ca87b 100644
183+
--- a/sig.c
184+
+++ b/sig.c
185+
@@ -60,6 +60,12 @@ extern int executing_list;
186+
extern int comsub_ignore_return;
187+
extern int parse_and_execute_level, shell_initialized;
188+
189+
+extern void initialize_siglist ();
190+
+
191+
+#if !defined (JOB_CONTROL)
192+
+extern void initialize_job_signals __P((void));
193+
+#endif
194+
+
195+
/* Non-zero after SIGINT. */
196+
volatile int interrupt_state = 0;
197+
198+
199+
diff --git a/siglist.h b/siglist.h
200+
index 4cb65308..bc0ea441 100644
201+
--- a/siglist.h
202+
+++ b/siglist.h
203+
@@ -18,6 +18,8 @@
204+
along with Bash. If not, see <http://www.gnu.org/licenses/>.
205+
*/
206+
207+
+#include <string.h>
208+
+
209+
#if !defined (_SIGLIST_H_)
210+
#define _SIGLIST_H_
211+
212+
213+
diff --git a/support/bashversion.c b/support/bashversion.c
214+
index abf1aa8d..59c2321e 100644
215+
--- a/support/bashversion.c
216+
+++ b/support/bashversion.c
217+
@@ -47,6 +47,9 @@ extern char *optarg;
218+
extern char *dist_version;
219+
extern int patch_level;
220+
221+
+extern char *shell_version_string __P((void));
222+
+extern void show_shell_version __P((int));
223+
+
224+
char *shell_name = "bash";
225+
char *progname;
226+

Diff for: 3.1/Dockerfile

+11-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)