[pacman-dev] [PATCH] makepkg: remove bash4 style output redirection
convert bash-4 "&>" style redirection to "2>&1" to maintain compatibility with bash-3.2 Signed-off-by: Allan McRae <allan@archlinux.org> --- scripts/makepkg.sh.in | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 126c5f5..8e2a523 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -370,7 +370,7 @@ download_file() { run_pacman() { local ret=0 if (( ! ASROOT )) && [[ $1 != "-T" && $1 != "-Qq" ]]; then - if [ "$(type -p sudo)" ] && sudo -l $PACMAN &>/dev/null; then + if [ "$(type -p sudo)" ] && sudo -l $PACMAN >/dev/null 2>&1; then sudo $PACMAN $PACMAN_OPTS "$@" || ret=$? else su -c "$PACMAN $PACMAN_OPTS $*" || ret=$? @@ -421,7 +421,7 @@ handle_deps() { # avoid triggering the ERR trap local restoretrap=$(trap -p ERR) trap - ERR - source /etc/profile &>/dev/null + source /etc/profile >/dev/null 2>&1 eval $restoretrap return $R_DEPS_SATISFIED @@ -479,7 +479,7 @@ remove_deps() { download_sources() { msg "$(gettext "Retrieving Sources...")" - pushd "$SRCDEST" &>/dev/null + pushd "$SRCDEST" >/dev/null 2>&1 local netfile for netfile in "${source[@]}"; do @@ -515,7 +515,7 @@ download_sources() { ln -s "$SRCDEST/$file" "$srcdir/" done - popd &>/dev/null + popd >/dev/null 2>&1 } get_integlist() { @@ -976,7 +976,7 @@ check_package() { done # check for references to the build directory - if grep -R "${srcdir}" "${pkgdir}" &>/dev/null; then + if grep -R "${srcdir}" "${pkgdir}" >/dev/null 2>&1; then warning "$(gettext "Package contains reference to %s")" "\$srcdir" fi } -- 1.7.1
On Sun, Jun 20, 2010 at 11:21, Allan McRae <allan@archlinux.org> wrote:
convert bash-4 "&>" style redirection to "2>&1" to maintain compatibility with bash-3.2
Signed-off-by: Allan McRae <allan@archlinux.org> ---
&> style redirection is supported by bash 3, as far as I know. Maybe even bash 2, but I don't have that on hand to test. Was this added in bash 3.3, or does 3.2 support it?
On 20.06.2010 18:15, Daenyth Blank wrote:
On Sun, Jun 20, 2010 at 11:21, Allan McRae <allan@archlinux.org> wrote:
convert bash-4 "&>" style redirection to "2>&1" to maintain compatibility with bash-3.2
Signed-off-by: Allan McRae <allan@archlinux.org> ---
&> style redirection is supported by bash 3, as far as I know. Maybe even bash 2, but I don't have that on hand to test. Was this added in bash 3.3, or does 3.2 support it?
I don't have access to a bash3 anymore, but you're right. It's mentioned in bash-3.2.48's man page. Maybe there was a bug that prevented it from working correctly or [1] is just wrong.
&>filename # Redirect both stdout and stderr to file "filename." # This operator is now functional, as of Bash 4, final release.
On Sun, Jun 20, 2010 at 12:19 PM, Cedric Staniewski <cedric@gmx.ca> wrote:
I don't have access to a bash3 anymore, but you're right. It's mentioned in bash-3.2.48's man page. Maybe there was a bug that prevented it from working correctly or [1] is just wrong.
&>filename # Redirect both stdout and stderr to file "filename." # This operator is now functional, as of Bash 4, final release.
No, the bash 4 only construct is appending: $ foo &>> bar Redirs of the form &>, which a *single* >, are fully functional in bash 3.2 Andres P
On 21/06/10 03:25, Andres P wrote:
On Sun, Jun 20, 2010 at 12:19 PM, Cedric Staniewski<cedric@gmx.ca> wrote:
I don't have access to a bash3 anymore, but you're right. It's mentioned in bash-3.2.48's man page. Maybe there was a bug that prevented it from working correctly or [1] is just wrong.
&>filename # Redirect both stdout and stderr to file "filename." # This operator is now functional, as of Bash 4, final release.
No, the bash 4 only construct is appending: $ foo&>> bar
Redirs of the form&>, which a *single*>, are fully functional in bash 3.2
I have tested and it looks like this has always worked in bash. Testing v3.0 on an old FC3 install showed no issues. I can only assume there must be some bug in it for the comment in [1] to be made, but until we strike it, I think there is no need to patch these out. Allan
On Sun, Jun 20, 2010 at 8:38 PM, Allan McRae <allan@archlinux.org> wrote:
On 21/06/10 03:25, Andres P wrote:
On Sun, Jun 20, 2010 at 12:19 PM, Cedric Staniewski<cedric@gmx.ca> wrote:
I don't have access to a bash3 anymore, but you're right. It's mentioned in bash-3.2.48's man page. Maybe there was a bug that prevented it from working correctly or [1] is just wrong.
&>filename # Redirect both stdout and stderr to file "filename." # This operator is now functional, as of Bash 4, final release.
No, the bash 4 only construct is appending: $ foo&>> bar
Redirs of the form&>, which a *single*>, are fully functional in bash 3.2
I have tested and it looks like this has always worked in bash. Testing v3.0 on an old FC3 install showed no issues. I can only assume there must be some bug in it for the comment in [1] to be made, but until we strike it, I think there is no need to patch these out.
OK, we'll scratch this patch then.
participants (5)
-
Allan McRae
-
Andres P
-
Cedric Staniewski
-
Daenyth Blank
-
Dan McGee