[libvirt] [PATCH] testscripts: make redirects happen in correct order

It should redirect stdout to /dev/null firstly, then redirect stderr to whatever stdout currently points at. Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com> --- tests/test-lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test-lib.sh b/tests/test-lib.sh index e612f8f..d36a901 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15 cd "$t_" || error_ "failed to cd to $t_" -if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then +if ( diff --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then compare() { diff -u "$@"; } -elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then compare() { cmp -s "$@"; } else compare() { cmp "$@"; } -- 1.9.3

On Wed, 2015-10-14 at 18:39 +0800, Wei Jiangang wrote:
It should redirect stdout to /dev/null firstly, then redirect stderr to whatever stdout currently points at.
Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com> --- tests/test-lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test-lib.sh b/tests/test-lib.sh index e612f8f..d36a901 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15
cd "$t_" || error_ "failed to cd to $t_"
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then +if ( diff --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then compare() { diff -u "$@"; } -elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then compare() { cmp -s "$@"; } else compare() { cmp "$@"; }
Pushed. Congratulations for your first contribution to libvirt! :) -- Andrea Bolognani Software Engineer - Virtualization Team

Pushed.
Congratulations for your first contribution to libvirt! :)
Thanks for your prompt reply. I'm glad to join this community. Regards, wei On Wed, 2015-10-14 at 13:12 +0200, Andrea Bolognani wrote:
On Wed, 2015-10-14 at 18:39 +0800, Wei Jiangang wrote:
It should redirect stdout to /dev/null firstly, then redirect stderr to whatever stdout currently points at.
Signed-off-by: Wei Jiangang <weijg.fnst@cn.fujitsu.com> --- tests/test-lib.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tests/test-lib.sh b/tests/test-lib.sh index e612f8f..d36a901 100644 --- a/tests/test-lib.sh +++ b/tests/test-lib.sh @@ -248,9 +248,9 @@ trap '(exit $?); exit $?' 1 2 13 15
cd "$t_" || error_ "failed to cd to $t_"
-if ( diff --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then +if ( diff --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then compare() { diff -u "$@"; } -elif ( cmp --version < /dev/null 2>&1 | grep GNU ) 2>&1 > /dev/null; then +elif ( cmp --version < /dev/null 2>&1 | grep GNU ) >/dev/null 2>&1; then compare() { cmp -s "$@"; } else compare() { cmp "$@"; }
Pushed.
Congratulations for your first contribution to libvirt! :)
participants (3)
-
Andrea Bolognani
-
Wei Jiangang
-
Wei, Jiangang