[pacman-dev] [PATCH] makepkg: remove bash4 style output redirection

Allan McRae allan at archlinux.org
Sun Jun 20 11:21:51 EDT 2010


convert bash-4 "&>" style redirection to "2>&1" to maintain
compatibility with bash-3.2

Signed-off-by: Allan McRae <allan at 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



More information about the pacman-dev mailing list