]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- skip colourization if output is not terminal
authorElan Ruusamäe <glen@pld-linux.org>
Fri, 26 Aug 2005 08:50:55 +0000 (08:50 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    builder.sh -> 1.326

builder.sh

index f09a18c1d4b9fa68b4b64a0bfb347f2a74fd9fae..49ca4f3273412c06ff6638de79eea1a9a369652e 100644 (file)
@@ -134,7 +134,7 @@ elif [ -n "$USE_AXEL" ]; then
 else
        wget --help 2>&1 | grep -q ' \-\-inet ' && WGET_OPTS="$WGET_OPTS --inet"
        wget --help 2>&1 | grep -q ' \-\-retry\-connrefused ' && WGET_OPTS="$WGET_OPTS --retry-connrefused"
-        
+
        GETURI="wget --passive-ftp -c -nd -t$WGET_RETRIES $WGET_OPTS"
        GETURI2="wget -c -nd -t$WGET_RETRIES $WGET_OPTS"
        OUTFILEOPT="-O"
@@ -1398,8 +1398,8 @@ adapterize()
 
         if [ "`diff --brief $SPECFILE $tmpdir/$SPECFILE`" ] ; then
                  diff -u $SPECFILE $tmpdir/$SPECFILE > $tmpdir/$SPECFILE.diff
-                 diffcol $tmpdir/$SPECFILE.diff | less -r
-                 (
+                 if [ -t 1 ]; then
+                               diffcol $tmpdir/$SPECFILE.diff | less -r
                                while : ; do
                                         echo -n "Accept? [yn] "
                                         read ans
@@ -1415,7 +1415,9 @@ adapterize()
                                         ;;
                                         esac
                                done
-                 )
+                 else
+                               cat $tmpdir/$SPECFILE.diff
+                 fi
         else
                  echo "The SPEC is perfect ;)"
         fi
This page took 0.084467 seconds and 4 git commands to generate.