Revert changes to clor conditions
authorZdeněk Šustr <sustr4@cesnet.cz>
Wed, 28 Jul 2010 15:33:14 +0000 (15:33 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Wed, 28 Jul 2010 15:33:14 +0000 (15:33 +0000)
Learn to take over terminal width from test wrapper.

org.glite.testsuites.ctb/LB/tests/test-common.sh

index 5957355..6a5c5ab 100644 (file)
@@ -55,7 +55,11 @@ if [ -z "${LINES}" -o -z "${COLUMNS}" ]; then
                COLUMNS=`echo ${stty_size} | awk '{print $2}'`
        else
                LINES=24
-               COLUMNS=80
+               if [ -z $LBTSTCOLS ]; then
+                       COLUMNS=$LBTSTCOLS
+               else            
+                       COLUMNS=80
+               fi
        fi
 fi
 if [ ! $LINES -ge 0 ]; then LINES=24; fi
@@ -246,8 +250,7 @@ function dprintf()
 }
 
 # by default set output to color if possible
-#if test -t 1 -a "$TERM" != "raw" -a "$TERM" != "dumb" && stty size <&1 > /dev/null 2>&1 ; then
-if test -t 1 -a "$TERM" != "raw" -a "$TERM" != "dumb" ; then
+if test -t 1 -a "$TERM" != "raw" -a "$TERM" != "dumb" && stty size <&1 > /dev/null 2>&1 ; then
        setOutputColor
 else
        setOutputASCII