[PATCH 5/7] test-hg.sh: avoid obsolete 'test' syntax
The POSIX spec says that the '-a', '-o', and parentheses operands to the 'test' utility are obsolete extensions due to the potential for ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. Signed-off-by: Richard Hansen --- contrib/remote-helpers/test-hg.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/remote-helpers/test-hg.sh b/contrib/remote-helpers/test-hg.sh index 558a656..84c67ff 100755 --- a/contrib/remote-helpers/test-hg.sh +++ b/contrib/remote-helpers/test-hg.sh @@ -83,7 +83,7 @@ check_push () { test $ref_ret -ne 0 && echo "match for '$branch' failed" && break done - if test $expected_ret -ne $ret -o $ref_ret -ne 0 + if test $expected_ret -ne $ret || test $ref_ret -ne 0 then return 1 fi -- 1.8.5.rc1.207.gc17dd22 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH 5/7] test-hg.sh: avoid obsolete 'test' syntax
Richard Hansen wrote: > The POSIX spec says that the '-a', '-o', and parentheses operands to > the 'test' utility are obsolete extensions due to the potential for > ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. All right, if you say so. -- Felipe Contreras -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/7] test-hg.sh: avoid obsolete 'test' syntax
On 2013-11-11 06:44, Felipe Contreras wrote: > Richard Hansen wrote: >> The POSIX spec says that the '-a', '-o', and parentheses operands to >> the 'test' utility are obsolete extensions due to the potential for >> ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. > > All right, if you say so. In case you're curious about what the spec says: http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 -Richard -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 5/7] test-hg.sh: avoid obsolete 'test' syntax
Richard Hansen wrote: > On 2013-11-11 06:44, Felipe Contreras wrote: > > Richard Hansen wrote: > >> The POSIX spec says that the '-a', '-o', and parentheses operands to > >> the 'test' utility are obsolete extensions due to the potential for > >> ambiguity. Replace '-o' with '|| test' to avoid unspecified behavior. > > > > All right, if you say so. > > In case you're curious about what the spec says: > > http://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html#tag_20_128_16 Thanks, I didn't know the POSIX spec was available publicly. -- Felipe Contreras -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html