summaryrefslogtreecommitdiff
path: root/dev-lang/elixir/files/elixir-1.11.2-mksh.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/elixir/files/elixir-1.11.2-mksh.patch')
-rw-r--r--dev-lang/elixir/files/elixir-1.11.2-mksh.patch81
1 files changed, 81 insertions, 0 deletions
diff --git a/dev-lang/elixir/files/elixir-1.11.2-mksh.patch b/dev-lang/elixir/files/elixir-1.11.2-mksh.patch
new file mode 100644
index 000000000000..3fda43156890
--- /dev/null
+++ b/dev-lang/elixir/files/elixir-1.11.2-mksh.patch
@@ -0,0 +1,81 @@
+From 69bb81635a77afb28419103bdb02867b48994d4a Mon Sep 17 00:00:00 2001
+From: "Haelwenn (lanodan) Monnier" <contact@hacktivis.me>
+Date: Wed, 9 Dec 2020 18:21:34 +0100
+Subject: [PATCH] bin/elixir: Rename erl() function to erl_set()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+It conflicted with the erl executable for Korn-derived shells where a function
+can be used in `exec command`.
+
+It isn't clear which behavior is expected from reading the POSIX specification
+but "Shell Command Language ยง 2.9.1 Simple Commands" clears the usage of
+the term `command` quite well.
+And even with excluding functions from the `command` operand of `exec`,
+why are aliases accepted? (in most if not all shells)
+
+See: https://bugs.gentoo.org/729964
+---
+ bin/elixir | 28 ++++++++++++++--------------
+ 1 file changed, 14 insertions(+), 14 deletions(-)
+
+--- a/bin/elixir
++++ b/bin/elixir
+@@ -70,7 +70,7 @@ readlink_f () {
+ ERL=""
+
+ # Stores erl arguments preserving spaces/quotes (mimics an array)
+-erl () {
++erl_set () {
+ eval "E${E}=\$1"
+ E=$((E + 1))
+ }
+@@ -137,34 +137,34 @@ while [ $I -le $LENGTH ]; do
+ ;;
+ --cookie)
+ S=2
+- erl "-setcookie"
+- erl "$2"
++ erl_set "-setcookie"
++ erl_set "$2"
+ ;;
+ --sname|--name)
+ S=2
+- erl "$(echo "$1" | cut -c 2-)"
+- erl "$2"
++ erl_set "$(echo "$1" | cut -c 2-)"
++ erl_set "$2"
+ ;;
+ --erl-config)
+ S=2
+- erl "-config"
+- erl "$2"
++ erl_set "-config"
++ erl_set "$2"
+ ;;
+ --vm-args)
+ S=2
+- erl "-args_file"
+- erl "$2"
++ erl_set "-args_file"
++ erl_set "$2"
+ ;;
+ --boot)
+ S=2
+- erl "-boot"
+- erl "$2"
++ erl_set "-boot"
++ erl_set "$2"
+ ;;
+ --boot-var)
+ S=3
+- erl "-boot_var"
+- erl "$2"
+- erl "$3"
++ erl_set "-boot_var"
++ erl_set "$2"
++ erl_set "$3"
+ ;;
+ --pipe-to)
+ S=3