bash: Update to 5.1

This commit is contained in:
Christoph Reiter
2020-12-19 17:07:19 +01:00
parent 52a8e96847
commit 451bbc53a8
3 changed files with 106 additions and 146 deletions

View File

@@ -140,23 +140,9 @@
if ((skip_ctlesc == 0 && c == CTLESC) || (skip_ctlnul == 0 && c == CTLNUL))
{
saw_escape++;
--- bash-4.4/builtins/set.def 2016-06-02 19:10:10.000000000 -0500
+++ bash-4.4/builtins/set.def 2017-01-27 13:11:50.793821100 -0600
@@ -56,6 +56,13 @@ extern int dont_save_function_defs;
#if defined (READLINE)
extern int no_line_editing;
#endif /* READLINE */
+#ifdef __CYGWIN__
+extern int igncr;
+static int set_minus_o_option_maybe (int, const char *, int);
+# define INTERACTIVE_ONLY ,1
+#else
+# define INTERACTIVE_ONLY
+#endif
$BUILTIN set
$FUNCTION set_builtin
@@ -92,6 +99,9 @@ Options:
--- bash-5.1/builtins/set.def.orig 2020-08-03 20:31:43.000000000 +0200
+++ bash-5.1/builtins/set.def 2020-12-19 16:38:45.649368400 +0100
@@ -85,6 +85,9 @@
#if defined (HISTORY)
history enable command history
#endif
@@ -166,7 +152,22 @@
ignoreeof the shell will not exit upon reading EOF
interactive-comments
allow comments to appear in interactive commands
@@ -192,29 +202,39 @@ const struct {
@@ -176,6 +179,14 @@
static int previous_option_value;
+#ifdef __CYGWIN__
+extern int igncr;
+static int set_minus_o_option_maybe (int, const char *, int);
+# define INTERACTIVE_ONLY ,1
+#else
+# define INTERACTIVE_ONLY
+#endif
+
/* A struct used to match long options for set -o to the corresponding
option letter or internal variable. The functions can be called to
dynamically generate values. If you add a new variable name here
@@ -187,29 +198,39 @@
int *variable;
setopt_set_func_t *set_func;
setopt_get_func_t *get_func;
@@ -210,7 +211,7 @@
#endif
{ "noclobber", 'C', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "noexec", 'n', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
@@ -233,7 +253,7 @@ const struct {
@@ -228,7 +249,7 @@
{ "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{ "verbose", 'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
#if defined (READLINE)
@@ -219,7 +220,7 @@
#endif
{ "xtrace", 'x', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
{(char *)NULL, 0 , (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
@@ -455,6 +475,15 @@ int
@@ -486,6 +507,15 @@
set_minus_o_option (on_or_off, option_name)
int on_or_off;
char *option_name;
@@ -235,18 +236,18 @@
{
register int i;
@@ -462,6 +491,10 @@ set_minus_o_option (on_or_off, option_na
{
if (STREQ (option_name, o_options[i].name))
{
@@ -496,6 +526,10 @@
return (EX_USAGE);
}
+#ifdef __CYGWIN__
+ if (o_options[i].interactive_only && avoid_interactive)
+ return EXECUTION_SUCCESS;
+#endif
if (o_options[i].letter == 0)
{
previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
@@ -588,7 +621,11 @@ parse_shellopts (value)
if (o_options[i].letter == 0)
{
previous_option_value = GET_BINARY_O_OPTION_VALUE (i, o_options[i].name);
@@ -616,7 +650,11 @@
vptr = 0;
while (vname = extract_colon_unit (value, &vptr))
{
@@ -258,11 +259,11 @@
free (vname);
}
}
--- bash-4.4/builtins/shopt.def 2016-05-06 14:00:02.000000000 -0500
+++ bash-4.4/builtins/shopt.def 2017-01-27 13:11:50.793821100 -0600
@@ -92,6 +92,10 @@ extern int glob_asciirange;
extern int lastpipe_opt;
extern int inherit_errexit;
--- bash-5.1/builtins/shopt.def.orig 2020-12-19 16:11:42.347711100 +0100
+++ bash-5.1/builtins/shopt.def 2020-12-19 16:11:50.709182800 +0100
@@ -94,6 +94,10 @@
extern int localvar_inherit;
extern int localvar_unset;
+#ifdef __CYGWIN__
+extern int completion_strip_exe;
@@ -271,10 +272,10 @@
#if defined (EXTENDED_GLOB)
extern int extended_glob;
#endif
@@ -169,6 +173,9 @@ static struct {
{ "compat41", &shopt_compat41, set_compatibility_level },
@@ -182,6 +186,9 @@
{ "compat42", &shopt_compat42, set_compatibility_level },
{ "compat43", &shopt_compat43, set_compatibility_level },
{ "compat44", &shopt_compat44, set_compatibility_level },
+#ifdef __CYGWIN__
+ { "completion_strip_exe", &completion_strip_exe, NULL },
+#endif
@@ -365,9 +366,9 @@
+.so man1/bash.1
.SH SEE ALSO
bash(1), sh(1)
--- bash-4.4/general.c 2016-08-11 10:16:56.000000000 -0500
+++ bash-4.4/general.c 2017-01-27 13:11:50.809402700 -0600
@@ -48,6 +48,10 @@
--- bash-5.1/general.c.orig 2020-07-28 20:35:53.000000000 +0200
+++ bash-5.1/general.c 2020-12-19 16:06:23.582528400 +0100
@@ -54,6 +54,10 @@
#include <tilde/tilde.h>
@@ -378,13 +379,12 @@
#if !defined (errno)
extern int errno;
#endif /* !errno */
@@ -718,7 +722,8 @@ make_absolute (string, dot_path)
{
@@ -830,7 +834,7 @@
char pathbuf[PATH_MAX + 1];
- cygwin_conv_to_full_posix_path (string, pathbuf);
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf,
+ sizeof pathbuf);
/* WAS cygwin_conv_to_full_posix_path (string, pathbuf); */
- cygwin_conv_path (CCP_WIN_A_TO_POSIX, string, pathbuf, PATH_MAX);
+ cygwin_conv_path (CCP_WIN_A_TO_POSIX | CCP_ABSOLUTE, string, pathbuf, PATH_MAX);
result = savestring (pathbuf);
}
#else
@@ -509,8 +509,8 @@
}
static int
--- bash-4.4/subst.c 2017-01-27 12:21:44.779343300 -0600
+++ bash-4.4/subst.c 2017-01-27 13:11:50.809402700 -0600
--- bash-5.1/subst.c.orig 2020-11-16 16:33:15.000000000 +0100
+++ bash-5.1/subst.c 2020-12-19 16:56:42.074812800 +0100
@@ -43,6 +43,7 @@
#include "posixstat.h"
#include "bashintl.h"
@@ -519,7 +519,7 @@
#include "shell.h"
#include "parser.h"
#include "flags.h"
@@ -5972,6 +5973,13 @@ read_comsub (fd, quoted, rflag)
@@ -6216,6 +6217,13 @@
#endif
continue;
}
@@ -532,8 +532,8 @@
+#endif
/* Add the character to ISTRING, possibly after resizing it. */
RESIZE_MALLOCED_BUFFER (istring, istring_index, 2, istring_size, DEFAULT_ARRAY_SIZE);
@@ -6096,6 +6104,28 @@ command_substitute (string, quoted)
RESIZE_MALLOCED_BUFFER (istring, istring_index, mb_cur_max+1, istring_size, 512);
@@ -6354,6 +6371,28 @@
goto error_exit;
}
@@ -559,9 +559,9 @@
+ }
+#endif /* __CYGWIN__ */
+
old_pid = last_made_pid;
#if defined (JOB_CONTROL)
old_pipeline_pgrp = pipeline_pgrp;
/* Don't reset the pipeline pgrp if we're already a subshell in a pipeline. */
--- bash-4.4/support/bashversion.c 2008-09-09 08:31:53.000000000 -0500
+++ bash-4.4/support/bashversion.c 2017-01-27 13:11:50.809402700 -0600
@@ -26,6 +26,9 @@

View File

@@ -1,16 +1,15 @@
diff -Naur a/configure.ac b/configure.ac
--- a/configure.ac 2014-02-11 19:37:53.000000000 +0400
+++ b/configure.ac 2014-03-13 16:36:06.373400000 +0400
@@ -88,7 +88,7 @@
*-machten4) opt_bash_malloc=no ;; # MachTen 4.x
*-bsdi2.1|*-bsdi3.?) opt_bash_malloc=no ; : ${CC:=shlicc2} ;; # for loadable builtins
*-beos*) opt_bash_malloc=no ;; # they say it's suitable
--- bash-5.1/configure.ac.orig 2020-12-04 15:04:55.000000000 +0100
+++ bash-5.1/configure.ac 2020-12-19 16:30:53.432216400 +0100
@@ -76,7 +76,7 @@
# These need additional investigation
sparc-linux*) opt_bash_malloc=no ;; # sparc running linux; requires ELF
*-aix*) opt_bash_malloc=no ;; # AIX machines
-*-cygwin*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
+*-cygwin*|msys*) opt_bash_malloc=no ;; # Cygnus's CYGWIN environment
*-opennt*|*-interix*) opt_bash_malloc=no ;; # Interix, now owned by Microsoft
*-nsk*) opt_bash_malloc=no ;; # HP NonStop
*-haiku*) opt_bash_malloc=no ;; # Haiku OS
@@ -437,6 +437,9 @@
# These lack a working sbrk(2)
aarch64-freebsd*) opt_bash_malloc=no ;;
riscv*-freebsd*) opt_bash_malloc=no ;;
@@ -446,6 +446,9 @@
*-cygwin*)
cross_cache=${srcdir}/cross-build/cygwin32.cache
;;
@@ -20,7 +19,7 @@ diff -Naur a/configure.ac b/configure.ac
*-mingw*)
cross_cache=${srcdir}/cross-build/cygwin32.cache
;;
@@ -568,7 +571,7 @@
@@ -580,7 +583,7 @@
# section for OS versions that don't allow unresolved symbols
# to be compiled into dynamic libraries.
case "$host_os" in
@@ -29,8 +28,8 @@ diff -Naur a/configure.ac b/configure.ac
esac
else
RL_LIBDIR='$(dot)/$(LIBSUBDIR)/readline'
@@ -1090,7 +1093,7 @@
*qnx6*) LOCAL_CFLAGS="-Dqnx -Dqnx6" LOCAL_LIBS="-lncurses" ;;
@@ -1168,7 +1171,7 @@
*qnx[[67]]*) LOCAL_LIBS="-lncurses" ;;
*qnx*) LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
powerux*) LOCAL_LIBS="-lgen" ;;
-cygwin*) LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
@@ -353,68 +352,75 @@ diff -Naur a/MANIFEST b/MANIFEST
cross-build/x86-beos.cache f
cross-build/opennt.cache f
include/ansi_stdlib.h f
diff -Naur a/support/config.guess b/support/config.guess
--- a/support/config.guess 2013-12-17 01:02:33.000000000 +0400
+++ b/support/config.guess 2014-03-13 16:36:06.404600000 +0400
@@ -823,6 +823,9 @@
--- bash-5.1/support/config.guess.orig 2020-11-18 20:38:39.000000000 +0100
+++ bash-5.1/support/config.guess 2020-12-19 16:27:26.381313600 +0100
@@ -876,6 +876,9 @@
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
echo "$UNAME_MACHINE"-pc-mingw64
exit ;;
+ i*:MSYS*:*)
+ echo ${UNAME_MACHINE}-pc-msys
+ exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
echo "$UNAME_MACHINE"-pc-mingw32
exit ;;
@@ -866,6 +869,9 @@
@@ -903,6 +906,9 @@
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
echo x86_64-pc-cygwin
exit ;;
+ amd64:MSYS*:*:* | x86_64:MSYS*:*:*)
+ echo x86_64-unknown-msys
+ echo x86_64-pc-msys
+ exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2"$(echo "$UNAME_RELEASE"|sed -e 's/[^.]*//')"
exit ;;
diff -Naur a/support/config.rpath b/support/config.rpath
--- a/support/config.rpath 2008-08-13 16:34:20.000000000 +0400
+++ b/support/config.rpath 2014-03-13 16:36:06.404600000 +0400
@@ -108,7 +108,7 @@
--- bash-5.1/support/config.rpath.orig 2020-12-19 16:21:12.539354600 +0100
+++ bash-5.1/support/config.rpath 2020-12-19 16:22:59.203761400 +0100
@@ -57,7 +57,7 @@
aix*)
wl='-Wl,'
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
@@ -149,7 +149,7 @@
hardcode_minus_L=no
case "$host_os" in
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -148,7 +148,7 @@
@@ -198,7 +198,7 @@
ld_shlibs=no
fi
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -267,7 +267,7 @@
@@ -348,7 +348,7 @@
;;
bsdi4*)
bsdi[45]*)
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -439,7 +439,7 @@
@@ -533,7 +533,7 @@
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
bsdi4*)
;;
- cygwin* | mingw* | pw32*)
+ cygwin* | msys* | mingw* | pw32*)
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
darwin* | rhapsody*)
diff -Naur a/support/shobj-conf b/support/shobj-conf
--- a/support/shobj-conf 2014-02-24 06:06:29.000000000 +0400
+++ b/support/shobj-conf 2014-03-13 16:36:06.451400000 +0400

View File

@@ -3,10 +3,10 @@
pkgbase=bash
pkgname=('bash' 'bash-devel')
_basever=4.4
_patchlevel=023 #prepare for some patches
_basever=5.1
_patchlevel=000 #prepare for some patches
pkgver=${_basever}.${_patchlevel}
pkgrel=2
pkgrel=1
pkgdesc="The GNU Bourne Again shell"
arch=('i686' 'x86_64')
license=('GPL')
@@ -123,56 +123,10 @@ package_bash-devel() {
done
}
sha256sums=('d86b3392c1202e8ff5a423b302e6284db7f8f435ea9f39b5b1b20fd3ac36dfcb'
sha256sums=('cc012bc860406dcf42f64431bcd3d2fa7560c02915a601aba9cd597a39329baa'
'SKIP'
'58345cdc35ef7588df46b029c7785969a80b1b7c4853ec6703734f719d1a0969'
'da08e4661fdcb179f7749dd1c8ce728d0ed8d4ca07e50da757046c06c6464dee'
'af29ed2eb7bce53ec09ea691c0054d8e3b4ac726a797a919951a5cba93e772ef'
'e1c76669ee5002b1ec06401224b94ece9a27fc722a6eb85ffaba272aad598001'
'c866eeb043090c13ab2ce6777ca6a24b31929fb58c4a6a221bca541fcc5d9949'
'9ef0a4686385a36c7a094ea8f5e9e973ee427c868952b2778f2f659347f74b32'
'82578a38798bfcfd85707c08e4f7b22c3fa7acc7a01d083faf86eb923511d60e'
'3e28d91531752df9a8cb167ad07cc542abaf944de9353fe8c6a535c9f1f17f0f'
'SKIP'
'7020a0183e17a7233e665b979c78c184ea369cfaf3e8b4b11f5547ecb7c13c53'
'SKIP'
'51df5a9192fdefe0ddca4bdf290932f74be03ffd0503a3d112e4199905e718b2'
'SKIP'
'ad080a30a4ac6c1273373617f29628cc320a35c8cd06913894794293dc52c8b3'
'SKIP'
'221e4b725b770ad0bb6924df3f8d04f89eeca4558f6e4c777dfa93e967090529'
'SKIP'
'6a8e2e2a6180d0f1ce39dcd651622fb6d2fd05db7c459f64ae42d667f1e344b8'
'SKIP'
'de1ccc07b7bfc9e25243ad854f3bbb5d3ebf9155b0477df16aaf00a7b0d5edaf'
'SKIP'
'86144700465933636d7b945e89b77df95d3620034725be161ca0ca5a42e239ba'
'SKIP'
'0b6bdd1a18a0d20e330cc3bc71e048864e4a13652e29dc0ebf3918bea729343c'
'SKIP'
'8465c6f2c56afe559402265b39d9e94368954930f9aa7f3dfa6d36dd66868e06'
'SKIP'
'dd56426ef7d7295e1107c0b3d06c192eb9298f4023c202ca2ba6266c613d170d'
'SKIP'
'fac271d2bf6372c9903e3b353cb9eda044d7fe36b5aab52f21f3f21cd6a2063e'
'SKIP'
'1b25efacbc1c4683b886d065b7a089a3601964555bcbf11f3a58989d38e853b6'
'SKIP'
'a7f75cedb43c5845ab1c60afade22dcb5e5dc12dd98c0f5a3abcfb9f309bb17c'
'SKIP'
'd37602ecbeb62d5a22c8167ea1e621fcdbaaa79925890a973a45c810dd01c326'
'SKIP'
'501f91cc89fadced16c73aa8858796651473602c722bb29f86a8ba588d0ff1b1'
'SKIP'
'773f90b98768d4662a22470ea8eec5fdd8e3439f370f94638872aaf884bcd270'
'SKIP'
'5bc494b42f719a8b0d844b7bd9ad50ebaae560e97f67c833c9e7e9d53981a8cc'
'SKIP'
'27170d6edfe8819835407fdc08b401d2e161b1400fe9d0c5317a51104c89c11e'
'SKIP'
'1840e2cbf26ba822913662f74037594ed562361485390c52813b38156c99522c'
'SKIP'
'bd8f59054a763ec1c64179ad5cb607f558708a317c2bdb22b814e3da456374c1'
'SKIP'
'45331f0936e36ab91bfe44b936e33ed8a1b1848fa896e8a1d0f2ef74f297cb79'
'SKIP'
'4fec236f3fbd3d0c47b893fdfa9122142a474f6ef66c20ffb6c0f4864dd591b6'
'SKIP')
'82578a38798bfcfd85707c08e4f7b22c3fa7acc7a01d083faf86eb923511d60e')