Skip to content

Commit f231ae4

Browse files
committed
bash: upgrade to v5.1(8)
This reverts the `.pdb` patch in Git for Windows' version of the package, as well as the `SIGNTOOL` one, and simply fast-forwards to MSYS2's version of Bash. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 48a7b45 commit f231ae4

51 files changed

Lines changed: 122 additions & 1935 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bash/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bash*-*

bash/0001-bash-4.4-cygwin.patch

Lines changed: 49 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -140,23 +140,9 @@
140140
if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL))
141141
{
142142
saw_escape++;
143-
--- bash-4.4/builtins/set.def 2016-06-02 19:10:10.000000000 -0500
144-
+++ bash-4.4/builtins/set.def 2017-01-27 13:11:50.793821100 -0600
145-
@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
146-
#if defined (READLINE)
147-
extern int no_line_editing;
148-
#endif /* READLINE */
149-
+#ifdef __CYGWIN__
150-
+extern int igncr;
151-
+static int set_minus_o_option_maybe (int, const char *, int);
152-
+# define INTERACTIVE_ONLY ,1
153-
+#else
154-
+# define INTERACTIVE_ONLY
155-
+#endif
156-
157-
$BUILTIN set
158-
$FUNCTION set_builtin
159-
@@ -92,6 +99,9 @@ Options:
143+
--- bash-5.1/builtins/set.def.orig 2020-08-03 20:31:43.000000000 +0200
144+
+++ bash-5.1/builtins/set.def 2020-12-19 16:38:45.649368400 +0100
145+
@@ -85,6 +85,9 @@
160146
#if defined (HISTORY)
161147
history enable command history
162148
#endif
@@ -166,7 +152,22 @@
166152
ignoreeof the shell will not exit upon reading EOF
167153
interactive-comments
168154
allow comments to appear in interactive commands
169-
@@ -192,29 +202,39 @@ const struct {
155+
@@ -176,6 +179,14 @@
156+
157+
static int previous_option_value;
158+
159+
+#ifdef __CYGWIN__
160+
+extern int igncr;
161+
+static int set_minus_o_option_maybe (int, const char *, int);
162+
+# define INTERACTIVE_ONLY ,1
163+
+#else
164+
+# define INTERACTIVE_ONLY
165+
+#endif
166+
+
167+
/* A struct used to match long options for set -o to the corresponding
168+
option letter or internal variable. The functions can be called to
169+
dynamically generate values. If you add a new variable name here
170+
@@ -187,29 +198,39 @@
170171
int *variable;
171172
setopt_set_func_t *set_func;
172173
setopt_get_func_t *get_func;
@@ -210,7 +211,7 @@
210211
#endif
211212
{ "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
212213
{ "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
213-
@@ -233,7 +253,7 @@ const struct {
214+
@@ -228,7 +249,7 @@
214215
{ "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
215216
{ "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
216217
#if defined (READLINE)
@@ -219,7 +220,7 @@
219220
#endif
220221
{ "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
221222
{(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
222-
@@ -455,6 +475,15 @@ int
223+
@@ -486,6 +507,15 @@
223224
set_minus_o_option (on_or_off, option_name)
224225
int on_or_off;
225226
char *option_name;
@@ -235,18 +236,18 @@
235236
{
236237
register int i;
237238

238-
@@ -462,6 +491,10 @@ set_minus_o_option (on_or_off, option_na
239-
{
240-
if (STREQ (option_name, o_options[i].name))
241-
{
239+
@@ -496,6 +526,10 @@
240+
return (EX_USAGE);
241+
}
242+
242243
+#ifdef __CYGWIN__
243244
+ if (o_options[i].interactive_only && avoid_interactive)
244245
+ return EXECUTION_SUCCESS;
245246
+#endif
246-
if (o_options[i].letter == 0)
247-
{
248-
previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
249-
@@ -588,7 +621,11 @@ parse_shellopts (value)
247+
if (o_options[i].letter == 0)
248+
{
249+
previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
250+
@@ -616,7 +650,11 @@
250251
vptr = 0;
251252
while (vname = extract_colon_unit (value, &vptr))
252253
{
@@ -258,11 +259,11 @@
258259
free (vname);
259260
}
260261
}
261-
--- bash-4.4/builtins/shopt.def 2016-05-06 14:00:02.000000000 -0500
262-
+++ bash-4.4/builtins/shopt.def 2017-01-27 13:11:50.793821100 -0600
263-
@@ -92,6 +92,10 @@ extern int glob_asciirange;
264-
extern int lastpipe_opt;
265-
extern int inherit_errexit;
262+
--- bash-5.1/builtins/shopt.def.orig 2020-12-19 16:11:42.347711100 +0100
263+
+++ bash-5.1/builtins/shopt.def 2020-12-19 16:11:50.709182800 +0100
264+
@@ -94,6 +94,10 @@
265+
extern int localvar_inherit;
266+
extern int localvar_unset;
266267

267268
+#ifdef __CYGWIN__
268269
+extern int completion_strip_exe;
@@ -271,10 +272,10 @@
271272
#if defined (EXTENDED_GLOB)
272273
extern int extended_glob;
273274
#endif
274-
@@ -169,6 +173,9 @@ static struct {
275-
{ "compat41", &shopt_compat41, set_compatibility_level },
275+
@@ -182,6 +186,9 @@
276276
{ "compat42", &shopt_compat42, set_compatibility_level },
277277
{ "compat43", &shopt_compat43, set_compatibility_level },
278+
{ "compat44", &shopt_compat44, set_compatibility_level },
278279
+#ifdef __CYGWIN__
279280
+ { "completion_strip_exe", &completion_strip_exe, NULL },
280281
+#endif
@@ -365,9 +366,9 @@
365366
+.so man1/bash.1
366367
.SH SEE ALSO
367368
bash(1), sh(1)
368-
--- bash-4.4/general.c 2016-08-11 10:16:56.000000000 -0500
369-
+++ bash-4.4/general.c 2017-01-27 13:11:50.809402700 -0600
370-
@@ -48,6 +48,10 @@
369+
--- bash-5.1/general.c.orig 2020-07-28 20:35:53.000000000 +0200
370+
+++ bash-5.1/general.c 2020-12-19 16:06:23.582528400 +0100
371+
@@ -54,6 +54,10 @@
371372

372373
#include <tilde/tilde.h>
373374

@@ -378,13 +379,12 @@
378379
#if !defined (errno)
379380
extern int errno;
380381
#endif /* !errno */
381-
@@ -718,7 +722,8 @@ make_absolute (string, dot_path)
382-
{
382+
@@ -830,7 +834,7 @@
383383
char pathbuf[PATH_MAX + 1];
384384

385-
- cygwin_conv_to_full_posix_path (string, pathbuf);
386-
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
387-
+ sizeof pathbuf);
385+
/* WAS cygwin_conv_to_full_posix_path (string, pathbuf); */
386+
- cygwin_conv_path (CCP_WIN_A_TO_POSIX, string, pathbuf, PATH_MAX);
387+
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf, PATH_MAX);
388388
result = savestring (pathbuf);
389389
}
390390
#else
@@ -509,8 +509,8 @@
509509
}
510510

511511
static int
512-
--- bash-4.4/subst.c 2017-01-27 12:21:44.779343300 -0600
513-
+++ bash-4.4/subst.c 2017-01-27 13:11:50.809402700 -0600
512+
--- bash-5.1/subst.c.orig 2020-11-16 16:33:15.000000000 +0100
513+
+++ bash-5.1/subst.c 2020-12-19 16:56:42.074812800 +0100
514514
@@ -43,6 +43,7 @@
515515
#include "posixstat.h"
516516
#include "bashintl.h"
@@ -519,7 +519,7 @@
519519
#include "shell.h"
520520
#include "parser.h"
521521
#include "flags.h"
522-
@@ -5972,6 +5973,13 @@ read_comsub (fd, quoted, rflag)
522+
@@ -6216,6 +6217,13 @@
523523
#endif
524524
continue;
525525
}
@@ -532,8 +532,8 @@
532532
+#endif
533533

534534
/* Add the character to ISTRING, possibly after resizing it. */
535-
RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
536-
@@ -6096,6 +6104,28 @@ command_substitute (string, quoted)
535+
RESIZE_MALLOCED_BUFFER (istring, istring_index, mb_cur_max+1, istring_size, 512);
536+
@@ -6354,6 +6371,28 @@
537537
goto error_exit;
538538
}
539539

@@ -559,9 +559,9 @@
559559
+ }
560560
+#endif /* __CYGWIN__ */
561561
+
562-
old_pid = last_made_pid;
563562
#if defined (JOB_CONTROL)
564563
old_pipeline_pgrp = pipeline_pgrp;
564+
/* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */
565565
--- bash-4.4/support/bashversion.c 2008-09-09 08:31:53.000000000 -0500
566566
+++ bash-4.4/support/bashversion.c 2017-01-27 13:11:50.809402700 -0600
567567
@@ -26,6 +26,9 @@

bash/0002-bash-4.3-msysize.patch

Lines changed: 50 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
diff -Naur a/configure.ac b/configure.ac
2-
--- a/configure.ac 2014-02-11 19:37:53.000000000 +0400
3-
+++ b/configure.ac 2014-03-13 16:36:06.373400000 +0400
4-
@@ -88,7 +88,7 @@
5-
*-machten4) opt_bash_malloc=no ;; # MachTen 4.x
6-
*-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
7-
*-beos*) opt_bash_malloc=no ;; # they say it's suitable
1+
--- bash-5.1/configure.ac.orig 2020-12-04 15:04:55.000000000 +0100
2+
+++ bash-5.1/configure.ac 2020-12-19 16:30:53.432216400 +0100
3+
@@ -76,7 +76,7 @@
4+
# These need additional investigation
5+
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
6+
*-aix*) opt_bash_malloc=no ;; # AIX machines
87
-*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
98
+*-cygwin*|msys*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
10-
*-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft
11-
*-nsk*) opt_bash_malloc=no ;; # HP NonStop
12-
*-haiku*) opt_bash_malloc=no ;; # Haiku OS
13-
@@ -437,6 +437,9 @@
9+
# These lack a working sbrk(2)
10+
aarch64-freebsd*) opt_bash_malloc=no ;;
11+
riscv*-freebsd*) opt_bash_malloc=no ;;
12+
@@ -446,6 +446,9 @@
1413
*-cygwin*)
1514
cross_cache=${srcdir}/cross-build/cygwin32.cache
1615
;;
@@ -20,7 +19,7 @@ diff -Naur a/configure.ac b/configure.ac
2019
*-mingw*)
2120
cross_cache=${srcdir}/cross-build/cygwin32.cache
2221
;;
23-
@@ -568,7 +571,7 @@
22+
@@ -580,7 +583,7 @@
2423
# section for OS versions that don't allow unresolved symbols
2524
# to be compiled into dynamic libraries.
2625
case "$host_os" in
@@ -29,8 +28,8 @@ diff -Naur a/configure.ac b/configure.ac
2928
esac
3029
else
3130
RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
32-
@@ -1090,7 +1093,7 @@
33-
*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
31+
@@ -1168,7 +1171,7 @@
32+
*qnx[[67]]*) LOCAL_LIBS="-lncurses" ;;
3433
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
3534
powerux*) LOCAL_LIBS="-lgen" ;;
3635
-cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
@@ -353,68 +352,75 @@ diff -Naur a/MANIFEST b/MANIFEST
353352
cross-build/x86-beos.cache f
354353
cross-build/opennt.cache f
355354
include/ansi_stdlib.h f
356-
diff -Naur a/support/config.guess b/support/config.guess
357-
--- a/support/config.guess 2013-12-17 01:02:33.000000000 +0400
358-
+++ b/support/config.guess 2014-03-13 16:36:06.404600000 +0400
359-
@@ -823,6 +823,9 @@
355+
--- bash-5.1/support/config.guess.orig 2020-11-18 20:38:39.000000000 +0100
356+
+++ bash-5.1/support/config.guess 2020-12-19 16:27:26.381313600 +0100
357+
@@ -876,6 +876,9 @@
360358
*:MINGW64*:*)
361-
echo ${UNAME_MACHINE}-pc-mingw64
359+
echo "$UNAME_MACHINE"-pc-mingw64
362360
exit ;;
363361
+ i*:MSYS*:*)
364362
+ echo ${UNAME_MACHINE}-pc-msys
365363
+ exit ;;
366364
*:MINGW*:*)
367-
echo ${UNAME_MACHINE}-pc-mingw32
365+
echo "$UNAME_MACHINE"-pc-mingw32
368366
exit ;;
369-
@@ -866,6 +869,9 @@
367+
@@ -903,6 +906,9 @@
370368
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
371-
echo x86_64-unknown-cygwin
369+
echo x86_64-pc-cygwin
372370
exit ;;
373371
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
374-
+ echo x86_64-unknown-msys
372+
+ echo x86_64-pc-msys
375373
+ exit ;;
376-
p*:CYGWIN*:*)
377-
echo powerpcle-unknown-cygwin
374+
prep*:SunOS:5.*:*)
375+
echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
378376
exit ;;
379-
diff -Naur a/support/config.rpath b/support/config.rpath
380-
--- a/support/config.rpath 2008-08-13 16:34:20.000000000 +0400
381-
+++ b/support/config.rpath 2014-03-13 16:36:06.404600000 +0400
382-
@@ -108,7 +108,7 @@
377+
--- bash-5.1/support/config.rpath.orig 2020-12-19 16:21:12.539354600 +0100
378+
+++ bash-5.1/support/config.rpath 2020-12-19 16:22:59.203761400 +0100
379+
@@ -57,7 +57,7 @@
380+
aix*)
381+
wl='-Wl,'
382+
;;
383+
- mingw* | cygwin* | pw32* | os2* | cegcc*)
384+
+ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
385+
;;
386+
hpux9* | hpux10* | hpux11*)
387+
wl='-Wl,'
388+
@@ -149,7 +149,7 @@
383389
hardcode_minus_L=no
384390

385391
case "$host_os" in
386-
- cygwin* | mingw* | pw32*)
387-
+ cygwin* | msys* | mingw* | pw32*)
392+
- cygwin* | mingw* | pw32* | cegcc*)
393+
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
388394
# FIXME: the MSVC++ port hasn't been tested in a loooong time
389395
# When not using gcc, we currently assume that we are using
390396
# Microsoft Visual C++.
391-
@@ -148,7 +148,7 @@
397+
@@ -198,7 +198,7 @@
392398
ld_shlibs=no
393399
fi
394400
;;
395-
- cygwin* | mingw* | pw32*)
396-
+ cygwin* | msys* | mingw* | pw32*)
401+
- cygwin* | mingw* | pw32* | cegcc*)
402+
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
397403
# hardcode_libdir_flag_spec is actually meaningless, as there is
398404
# no search path for DLLs.
399405
hardcode_libdir_flag_spec='-L$libdir'
400-
@@ -267,7 +267,7 @@
406+
@@ -348,7 +348,7 @@
401407
;;
402-
bsdi4*)
408+
bsdi[45]*)
403409
;;
404-
- cygwin* | mingw* | pw32*)
405-
+ cygwin* | msys* | mingw* | pw32*)
410+
- cygwin* | mingw* | pw32* | cegcc*)
411+
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
406412
# When not using gcc, we currently assume that we are using
407413
# Microsoft Visual C++.
408414
# hardcode_libdir_flag_spec is actually meaningless, as there is
409-
@@ -439,7 +439,7 @@
410-
;;
411-
bsdi4*)
415+
@@ -533,7 +533,7 @@
416+
bsdi[45]*)
417+
library_names_spec='$libname$shrext'
412418
;;
413-
- cygwin* | mingw* | pw32*)
414-
+ cygwin* | msys* | mingw* | pw32*)
419+
- cygwin* | mingw* | pw32* | cegcc*)
420+
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
415421
shrext=.dll
422+
library_names_spec='$libname.dll.a $libname.lib'
416423
;;
417-
darwin* | rhapsody*)
418424
diff -Naur a/support/shobj-conf b/support/shobj-conf
419425
--- a/support/shobj-conf 2014-02-24 06:06:29.000000000 +0400
420426
+++ b/support/shobj-conf 2014-03-13 16:36:06.451400000 +0400

bash/0008-Generate-a-.pdb-file-too.patch

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)