Re: [PATCH] {tests-init} Tests defs: de-uglify code for requiring an XSI-capable shell.

2010-12-13 Thread Ralf Wildenhues
* Stefano Lattarini wrote on Sun, Dec 12, 2010 at 10:06:58PM CET:
 This is just a cosmetic patch.  I will push in 72 hours
 (Wednesday evening) if nobody objects.

Please don't.  It's a feature that the code is the same as the one
tested in Libtool _LT_CHECK_SHELL_FEATURES: bug-tested and all.
I don't see this fixing a bug, so it can only regress.

Thanks,
Ralf

 Tests defs: de-uglify code for requiring an XSI-capable shell.
 
 * tests/defs (xsi-shell): Use `foo', not `_am_dummy', as test
 variable.  Use multiple eval where appropriate.  Indent using
 only spaces, not tabs.



Re: [PATCH] {tests-init} Tests defs: de-uglify code for requiring an XSI-capable shell.

2010-12-13 Thread Stefano Lattarini
On Monday 13 December 2010, Ralf Wildenhues wrote:
 * Stefano Lattarini wrote on Sun, Dec 12, 2010 at 10:06:58PM CET:
  This is just a cosmetic patch.  I will push in 72 hours
  (Wednesday evening) if nobody objects.
 
 Please don't.  It's a feature that the code is the same as the one
 tested in Libtool _LT_CHECK_SHELL_FEATURES: bug-tested and all.

Ah, ok,  What about adding a comment about this fact then?  So that
someone reading the code can tell OK, this is ugly, but for a good
reason indeed; better not touch it.

 I don't see this fixing a bug,

It doesn't.

 so it can only regress.
 
 Thanks,
 Ralf
 

Regards,
   Stefano



Re: [PATCH] {tests-init} Tests defs: de-uglify code for requiring an XSI-capable shell.

2010-12-13 Thread Stefano Lattarini
On Monday 13 December 2010, Ralf Wildenhues wrote:
 * Stefano Lattarini wrote on Mon, Dec 13, 2010 at 08:16:47PM CET:
  On Monday 13 December 2010, Ralf Wildenhues wrote:
   * Stefano Lattarini wrote on Sun, Dec 12, 2010 at 10:06:58PM CET:
This is just a cosmetic patch.  I will push in 72 hours
(Wednesday evening) if nobody objects.
   
   Please don't.  It's a feature that the code is the same as the one
   tested in Libtool _LT_CHECK_SHELL_FEATURES: bug-tested and all.
  
  Ah, ok,  What about adding a comment about this fact then?  So that
  someone reading the code can tell OK, this is ugly, but for a good
  reason indeed; better not touch it.
 
 Sure, how about just:
   Keep this in sync with libtool.m4:_LT_CHECK_SHELL_FEATURES.
 
I agree.  I will add it soonish (and post a proper [FYI] massage
once I've done it).

Thanks,
  Stefano



[PATCH] {tests-init} Tests defs: de-uglify code for requiring an XSI-capable shell.

2010-12-12 Thread Stefano Lattarini
This is just a cosmetic patch.  I will push in 72 hours
(Wednesday evening) if nobody objects.

Regards,
   Stefano

-*-*-*-

Tests defs: de-uglify code for requiring an XSI-capable shell.

* tests/defs (xsi-shell): Use `foo', not `_am_dummy', as test
variable.  Use multiple eval where appropriate.  Indent using
only spaces, not tabs.
---
 ChangeLog  |7 +++
 tests/defs |9 -
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b3f0e49..9f46fc6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-12-12  Stefano Lattarini  stefano.lattar...@gmail.com
+
+   Tests defs: de-uglify code for requiring an XSI-capable shell.
+   * tests/defs (xsi-shell): Use `foo', not `_am_dummy', as test
+   variable.  Use multiple eval where appropriate.  Indent using
+   only spaces, not tabs.
+
 2010-11-12  Stefano Lattarini  stefano.lattar...@gmail.com
 
Tests required tools: also try `-v' option for GNU compilers.
diff --git a/tests/defs b/tests/defs
index 02f9ad0..0a1ae1e 100644
--- a/tests/defs
+++ b/tests/defs
@@ -297,11 +297,10 @@ do
 xsi-shell)
   # Try some XSI features.
   echo $me: trying some XSI constructs
-  ( _am_dummy=a/b/c
-   test 
${_am_dummy##*/},${_am_dummy%/*},${_am_dummy#??}${_am_dummy%$_am_dummy}, \
-   = c,a/b,b/c, \
-eval 'test $(( 1 + 1 )) -eq 2 \
-test ${#_am_dummy} -eq 5' ) || exit 77
+  ( foo=a/b/c
+test ${foo##*/},${foo%/*},${foo#??}${foo%$foo}, = c,a/b,b/c, \
+   eval 'test $(( 1 + 1 )) -eq 2' \
+   eval 'test ${#foo} -eq 5' ) || exit 77
   ;;
 *)
   # Generic case: the tool must support --version.
-- 
1.7.1