Commit 79bfdbb2 authored by Natanael Copa's avatar Natanael Copa
Browse files

main/vim: fix shellpipe for ash and dash

vim uses a list of known shells to include stderr in the redirection for
shellpipe. Include busybox ash and dash to this list.

It would be better to use POSIX redirection by default, but that would
break backwards compatibility of default behavior.

Submitted upstream: https://github.com/vim/vim/pull/8180
parent 0f55d1f9
......@@ -4,7 +4,7 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=vim
pkgver=8.2.2822
pkgrel=0
pkgrel=1
pkgdesc="Improved vi-style text editor"
url="https://www.vim.org/"
arch="all"
......@@ -14,6 +14,7 @@ depends="xxd"
makedepends="ncurses-dev lua5.3-dev python3-dev gtk+3.0-dev libx11-dev libxt-dev"
subpackages="$pkgname-doc ${pkgname}diff::noarch $pkgname-tutor $pkgname-help gvim xxd"
source="$pkgname-$pkgver.tar.gz::https://github.com/vim/vim/archive/v$pkgver.tar.gz
posix-shell-redirection.patch
vimrc
"
......@@ -130,5 +131,6 @@ xxd() {
sha512sums="
2c0d7fe3f15b24100197097513b7312f3e3a921bdbe352344c19d69ece6dba3b089f550632731aea4f9559783a00fdb206ee8362bc413364ea37397c7e307c0b vim-8.2.2822.tar.gz
270a967ffb322dfaff2baee49edf12550ddb72414718b44a66023563142c1e69b844e39801a32fcc2a3df0cedeb6b7cd63a1872f84c8416e6e9f527ff036d14a posix-shell-redirection.patch
d9586b777881973cb5e48e18750336a522ed72c3127b2d6b6991e2b943468ca5b694476e7fa39ab469178c1375fc8f52627484e0fe377aea5811a513e35a7b02 vimrc
"
upstream: https://github.com/vim/vim/pull/8180
From 52487608e757f64c137f532b3ded14fb97a62e92 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 6 May 2021 11:38:53 +0200
Subject: [PATCH] Use POSIX style redirect for ash and dash in shellpipe
Update comment to say "POSIX style redirection" since the `2>&1`
redirection is specified in POSIX and is not a bourne shell specific
thing[1][2].
Add busybox ash and dash to the list of known POSIX compatible shells so
stderr is captured when SHELL is set to one of those.
Add dash.exe to windows but not ash, since busybox ash does not run on
windows.
[1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_02
[2]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_07_06
---
runtime/doc/options.txt | 6 +++---
src/option.c | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt
index 84969b23f65..efab64802e5 100644
--- a/runtime/doc/options.txt
+++ b/runtime/doc/options.txt
@@ -6606,9 +6606,9 @@ A jump table for the options with a short description can be found at |Q_op|.
in a file and echoed to the screen. If the 'shell' option is "csh" or
"tcsh" after initializations, the default becomes "|& tee". If the
'shell' option is "sh", "ksh", "mksh", "pdksh", "zsh", "zsh-beta",
- "bash" or "fish" the default becomes "2>&1| tee". This means that
- stderr is also included. Before using the 'shell' option a path is
- removed, thus "/bin/sh" uses "sh".
+ "bash", "fish", "ash" or "dash" the default becomes "2>&1| tee". This
+ means that stderr is also included. Before using the 'shell' option a
+ path is removed, thus "/bin/sh" uses "sh".
The initialization of this option is done after reading the ".vimrc"
and the other initializations, so that when the 'shell' option is set
there, the 'shellpipe' option changes automatically, unless it was
diff --git a/src/option.c b/src/option.c
index 3c248c19319..7c783757b2d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -910,7 +910,7 @@ set_init_3(void)
}
}
else
- // Always use bourne shell style redirection if we reach this
+ // Always use POSIX shell style redirection if we reach this
if ( fnamecmp(p, "sh") == 0
|| fnamecmp(p, "ksh") == 0
|| fnamecmp(p, "mksh") == 0
@@ -919,6 +919,8 @@ set_init_3(void)
|| fnamecmp(p, "zsh-beta") == 0
|| fnamecmp(p, "bash") == 0
|| fnamecmp(p, "fish") == 0
+ || fnamecmp(p, "ash") == 0
+ || fnamecmp(p, "dash") == 0
# ifdef MSWIN
|| fnamecmp(p, "cmd") == 0
|| fnamecmp(p, "sh.exe") == 0
@@ -929,6 +931,7 @@ set_init_3(void)
|| fnamecmp(p, "zsh-beta.exe") == 0
|| fnamecmp(p, "bash.exe") == 0
|| fnamecmp(p, "cmd.exe") == 0
+ || fnamecmp(p, "dash.exe") == 0
# endif
)
{
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment