Paul E. McKenney wrote:
On Wed, Jul 16, 2008 at 01:16:42PM +0530, Subrata Modak wrote:
On Tue, 2008-07-15 at 20:49 -0700, Paul E. McKenney wrote:
On Mon, Jul 14, 2008 at 11:29:35PM +0530, Subrata Modak wrote:
On Thu, 2008-07-10 at 07:59 -0700, Paul E. McKenney wrote:
Someone has to have seen this already, but just in case...

LTP fails to build on systems for which /bin/sh really is an old-style
Bourne shell (which by the way is what /bin/sh is defined to be).
The following patch fixes at least one instance of this.

Signed-off-by: Paul E. McKenney <[EMAIL PROTECTED]>
Hi paul,

Thanks for highlighting this issue. But we will not resort this to point
to /bin/bash as in many Linux system /bin/sh points to some other
Posix-compliant Shell(s). However i agree that on most systems it points
to /bin/bash. We would encourage you to change the link /bin/sh to a
shell of your choice.
Which I did do.  But it kind of defeats ABAT's LTP feature, not?
ThatÅ› true. But LTP is being used by people outside IBM as well. We may
need to sync with others in the community as well.

So everyone wants LTP to fail one Linux distros that happen to make
/bin/sh be a real Bourne shell?  Sounds like this kind of defeats the
purpose of testing...

Hi Paul, Subrata and LTP,

Probably, I faced the same problem that Paul is trying to fix (in testcases/network/generate.sh) when building ltp from source on Ubuntu Gutsy.
As far as I could see, it is something related to the fact that Ubuntu uses dash as 
default '/bin/sh' and its version (in my case, 0.5.4-1ubuntu3) doesn't support nested 
arithmetic operations, like "$((cnt=cnt-1))".

This trivial patch replaces these operations following an example from Open 
Group specifications ( 
http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_04).

Also, I've already tried this using ksh (version 93s+ 2008-01-31) and bash 
(3.2.39). I hope it helps.

Best regards,


                                                        Thanx, Paul

Regards--
Subrata

                                                Thanx, Paul

Regards--
Subrata

---

diff -urpNa -X ../../../dontdiff 
ltp-full-20080131/testcases/network/generate.sh 
ltp-full-20080131-bash/testcases/network/generate.sh
--- ltp-full-20080131/testcases/network/generate.sh     2008-07-10 
07:26:04.000000000 -0700
+++ ltp-full-20080131-bash/testcases/network/generate.sh        2008-07-10 
07:22:30.000000000 -0700
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
 #
 #   Copyright (c) International Business Machines  Corp., 2001
 #


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

--
Edjunior Barbosa Machado
IBM Linux Technology Center
Linux Defect Support Team
It replaces nested arithmetic operations following example from Open Group 
specifications, in order to avoid issues with different shells, like
dash from Ubuntu Gutsy.

Signed-off-by: Edjunior Barbosa Machado <[EMAIL PROTECTED]>

--- ltp-intermediate-20080717/testcases/network/generate.sh	2008-07-17 14:16:07.000000000 +0000
+++ ltp-intermediate-20080717-mod/testcases/network/generate.sh	2008-07-23 05:13:01.000000000 +0000
@@ -53,22 +53,24 @@
 $makeit $data_dir/$jumbo_file $jumbo_size
 
 if [ ! -e $data_dir/bin.sm ] ; then
-	cnt=6
-	while [ $((cnt=cnt-1)) -ge 0 ] ; do
+	cnt=5
+	while [ $cnt -ge 0 ] ; do
 		gzip -1 -c datafiles/ascii.sm >> $data_dir/bin.sm
+		cnt=$(($cnt-1))
 	done
 fi
 
 genfile() {
 	local input=$data_dir/$1 output=$data_dir/$2
-	local cnt=20
+	local cnt=19
 
 	if [ -e $output ] ; then
 		return 0
 	fi
 
-	while [ $((cnt=cnt-1)) -ge 0 ] ; do
+	while [ $cnt -ge 0 ] ; do
 		cat $input >> $output
+		cnt=$(($cnt-1))
 	done
 }
 
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to