From e26a2b6a87fbf4efd711c2fa65a80f2400392f11 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Thu, 6 Oct 2022 09:58:20 +0200 Subject: [PATCH] Update to bash-5.2 patchlevel 2 --- bash-5.2-patch-1.patch | 24 ++++++++++++++++++++++++ bash-5.2-patch-2.patch | 25 +++++++++++++++++++++++++ bash.spec | 13 +++++++++---- 3 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 bash-5.2-patch-1.patch create mode 100644 bash-5.2-patch-2.patch diff --git a/bash-5.2-patch-1.patch b/bash-5.2-patch-1.patch new file mode 100644 index 0000000..30ba586 --- /dev/null +++ b/bash-5.2-patch-1.patch @@ -0,0 +1,24 @@ +diff --git a/patchlevel.h b/patchlevel.h +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 0 ++#define PATCHLEVEL 1 + + #endif /* _PATCHLEVEL_H_ */ +diff --git a/subst.c b/subst.c +index d9feabca..93b91606 100644 +--- a/subst.c ++++ b/subst.c +@@ -10857,7 +10857,7 @@ expand_array_subscript (string, sindex, quoted, flags) + exp = substring (string, si+1, ni); + t = expand_subscript_string (exp, quoted & ~(Q_ARITH|Q_DOUBLE_QUOTES)); + free (exp); +- exp = sh_backslash_quote (t, abstab, 0); ++ exp = t ? sh_backslash_quote (t, abstab, 0) : savestring (""); + free (t); + + slen = STRLEN (exp); diff --git a/bash-5.2-patch-2.patch b/bash-5.2-patch-2.patch new file mode 100644 index 0000000..3c5ff0f --- /dev/null +++ b/bash-5.2-patch-2.patch @@ -0,0 +1,25 @@ +diff --git a/lib/readline/nls.c b/lib/readline/nls.c +--- a/lib/readline/nls.c ++++ b/lib/readline/nls.c +@@ -141,6 +141,10 @@ _rl_init_locale (void) + if (lspec == 0) + lspec = ""; + ret = setlocale (LC_CTYPE, lspec); /* ok, since it does not change locale */ ++ if (ret == 0 || *ret == 0) ++ ret = setlocale (LC_CTYPE, (char *)NULL); ++ if (ret == 0 || *ret == 0) ++ ret = RL_DEFAULT_LOCALE; + #else + ret = (lspec == 0 || *lspec == 0) ? RL_DEFAULT_LOCALE : lspec; + #endif +diff --git a/patchlevel.h b/patchlevel.h +--- a/patchlevel.h ++++ b/patchlevel.h +@@ -25,6 +25,6 @@ + regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh + looks for to find the patch level (for the sccs version string). */ + +-#define PATCHLEVEL 1 ++#define PATCHLEVEL 2 + + #endif /* _PATCHLEVEL_H_ */ diff --git a/bash.spec b/bash.spec index 55959d5..799be7b 100644 --- a/bash.spec +++ b/bash.spec @@ -1,12 +1,12 @@ #% define beta_tag rc2 -%define patchleveltag .0 +%define patchlevel 2 %define baseversion 5.2 %bcond_without tests -Version: %{baseversion}%{patchleveltag} +Version: %{baseversion}.%{patchlevel} Name: bash Summary: The GNU Bourne Again shell -Release: 2%{?dist} +Release: 1%{?dist} License: GPLv3+ Url: https://www.gnu.org/software/bash Source0: https://ftp.gnu.org/gnu/bash/bash-%{baseversion}.tar.gz @@ -20,7 +20,9 @@ Source3: dot-bash_logout # Official upstream patches # Patches are converted to apply with '-p1' -#{lua:for i=1,16 do print(string.format("Patch%u: bash-5.1-patch-%u.patch\n", i, i)) end} +%{lua:for i=1,rpm.expand('%{patchlevel}') do + print(string.format('Patch%u: bash-%s-patch-%u.patch\n', i, rpm.expand('%{baseversion}'), i)) +end} # Other patches # We don't want to add '/etc:/usr/etc' in standard utils path. @@ -318,6 +320,9 @@ end %{_libdir}/pkgconfig/%{name}.pc %changelog +* Thu Oct 06 2022 Siteshwar Vashisht - 5.2.2-1 +- Update to bash-5.2 patchlevel 2 + * Wed Oct 05 2022 Siteshwar Vashisht - 5.2.0-2 - Bump version number Related: #2129927