[pacman-dev] [PATCH 1/3] Fix stderr redirection

Cedric Staniewski cedric at gmx.ca
Tue May 12 04:59:34 EDT 2009


When redirecting both stderr and stdout and using the 2>&1 construct,
you have to redirect stdout first. Otherwise stderr will be redirected to
the 'old' stdout and not to the new resource.

Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
---
 acinclude.m4           |    4 ++--
 scripts/repo-add.sh.in |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/acinclude.m4 b/acinclude.m4
index 1524a3d..94ddb2b 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -234,7 +234,7 @@ AC_DEFUN([_LT_COMPILER_BOILERPLATE],
 [AC_REQUIRE([LT_AC_PROG_SED])dnl
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_compile_test_code" >conftest.$ac_ext
-eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+eval "$ac_compile" >/dev/null 2>&1 | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_compiler_boilerplate=`cat conftest.err`
 $rm conftest*
 ])# _LT_COMPILER_BOILERPLATE
@@ -248,7 +248,7 @@ AC_DEFUN([_LT_LINKER_BOILERPLATE],
 [AC_REQUIRE([LT_AC_PROG_SED])dnl
 ac_outfile=conftest.$ac_objext
 echo "$lt_simple_link_test_code" >conftest.$ac_ext
-eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+eval "$ac_link" >/dev/null 2>&1 | $SED '/^$/d; /^ *+/d' >conftest.err
 _lt_linker_boilerplate=`cat conftest.err`
 $rm conftest*
 ])# _LT_LINKER_BOILERPLATE
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 2390a92..13097df 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -341,7 +341,7 @@ add()
 	fi
 
 	pkgfile=$1
-	if ! bsdtar -tf "$pkgfile" .PKGINFO 2>&1 >/dev/null; then
+	if ! bsdtar -tf "$pkgfile" .PKGINFO >/dev/null 2>&1; then
 		error "$(gettext "'%s' is not a package file, skipping")" "$pkgfile"
 		return 1
 	fi
-- 
1.6.3



More information about the pacman-dev mailing list