From b62cfa99c3583b5c77490b0875390d0d813706a5 Mon Sep 17 00:00:00 2001 From: Emily Date: Thu, 1 Aug 2024 14:21:50 +0100 Subject: [PATCH] bash: add upstream fix for `pop_var_context` error Closes: #214822 --- pkgs/shells/bash/5.nix | 2 ++ .../shells/bash/fix-pop-var-context-error.patch | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 pkgs/shells/bash/fix-pop-var-context-error.patch diff --git a/pkgs/shells/bash/5.nix b/pkgs/shells/bash/5.nix index e36d69593bd3..b2167b9ef7fa 100644 --- a/pkgs/shells/bash/5.nix +++ b/pkgs/shells/bash/5.nix @@ -61,6 +61,8 @@ stdenv.mkDerivation rec { # https://savannah.gnu.org/patch/index.php?10373 # Had to fetch manually to workaround -p0 default. ./parallel.patch + # Fix `pop_var_context: head of shell_variables not a function context`. + ./fix-pop-var-context-error.patch ]; configureFlags = [ diff --git a/pkgs/shells/bash/fix-pop-var-context-error.patch b/pkgs/shells/bash/fix-pop-var-context-error.patch new file mode 100644 index 000000000000..1b8d5ae20b31 --- /dev/null +++ b/pkgs/shells/bash/fix-pop-var-context-error.patch @@ -0,0 +1,17 @@ +Excerpted from . + +Original author: Chet Ramey + +--- variables.c ++++ variables.c +@@ -5413,7 +5413,9 @@ pop_var_context () + vcxt = shell_variables; + if (vc_isfuncenv (vcxt) == 0) + { +- internal_error (_("pop_var_context: head of shell_variables not a function context")); ++ /* If we haven't flushed all of the local contexts already, flag an error */ ++ if (shell_variables != global_variables || variable_context > 0) ++ internal_error (_("pop_var_context: head of shell_variables not a function context")); + return; + } +