git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
@ 2012-03-02 10:33 Stefano Lattarini
  2012-03-02 18:38 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Lattarini @ 2012-03-02 10:33 UTC (permalink / raw)
  To: git; +Cc: gitster

If any test script is run directly with Solaris 10 /usr/xpg4/bin/sh or
/bin/ksh, it fails spuriously with a message like:

  t0000-basic.sh[31]: unset: bad argument count

This happens because those shells bail out when encountering a call to
"unset" with no arguments, and such unset call could take place in
'test-lib.sh'.  Fix that issue, and add a proper comment to ensure we
don't regress in this respect.
---
 t/test-lib.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index a089a18..c0d04c4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -42,10 +42,11 @@ TZ=UTC
 TERM=dumb
 export LANG LC_ALL PAGER TERM TZ
 EDITOR=:
-unset VISUAL
-unset EMAIL
-unset LANGUAGE
-unset $(perl -e '
+# A call to "unset" with no arguments causes at least Solaris 10
+# /usr/xpg4/bin/sh and /bin/ksh to bail out.  So keep the unsets
+# deriving from the command substitution clustered with the other
+# ones.
+unset VISUAL EMAIL LANGUAGE $(perl -e '
 	my @env = keys %ENV;
 	my $ok = join("|", qw(
 		TRACE
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
  2012-03-02 10:33 [PATCH] tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh Stefano Lattarini
@ 2012-03-02 18:38 ` Junio C Hamano
  2012-03-02 18:48   ` [PATCH v2] " Stefano Lattarini
  0 siblings, 1 reply; 4+ messages in thread
From: Junio C Hamano @ 2012-03-02 18:38 UTC (permalink / raw)
  To: Stefano Lattarini; +Cc: git

This patch looks good, but please sign-off.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v2] tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
  2012-03-02 18:38 ` Junio C Hamano
@ 2012-03-02 18:48   ` Stefano Lattarini
  2012-03-02 22:41     ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Stefano Lattarini @ 2012-03-02 18:48 UTC (permalink / raw)
  To: git; +Cc: gitster

If any test script is run directly with Solaris 10 /usr/xpg4/bin/sh or
/bin/ksh, it fails spuriously with a message like:

  t0000-basic.sh[31]: unset: bad argument count

This happens because those shells bail out when encountering a call to
"unset" with no arguments, and such unset call could take place in
'test-lib.sh'.  Fix that issue, and add a proper comment to ensure we
don't regress in this respect.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
---

 Changes from the previous version: add a proper "Signed-off-by" line,
 which I had forgotten in the previous version.  Sorry for the confusion.

 t/test-lib.sh |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index a089a18..c0d04c4 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -42,10 +42,11 @@ TZ=UTC
 TERM=dumb
 export LANG LC_ALL PAGER TERM TZ
 EDITOR=:
-unset VISUAL
-unset EMAIL
-unset LANGUAGE
-unset $(perl -e '
+# A call to "unset" with no arguments causes at least Solaris 10
+# /usr/xpg4/bin/sh and /bin/ksh to bail out.  So keep the unsets
+# deriving from the command substitution clustered with the other
+# ones.
+unset VISUAL EMAIL LANGUAGE $(perl -e '
 	my @env = keys %ENV;
 	my $ok = join("|", qw(
 		TRACE
-- 
1.7.9

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh
  2012-03-02 18:48   ` [PATCH v2] " Stefano Lattarini
@ 2012-03-02 22:41     ` Junio C Hamano
  0 siblings, 0 replies; 4+ messages in thread
From: Junio C Hamano @ 2012-03-02 22:41 UTC (permalink / raw)
  To: Stefano Lattarini; +Cc: git

Thanks.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-02 22:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-02 10:33 [PATCH] tests: fix spurious error when run directly with Solaris /usr/xpg4/bin/sh Stefano Lattarini
2012-03-02 18:38 ` Junio C Hamano
2012-03-02 18:48   ` [PATCH v2] " Stefano Lattarini
2012-03-02 22:41     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).