From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6366 invoked by alias); 16 Sep 2014 08:28:33 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 33175 Received: (qmail 5385 invoked from network); 16 Sep 2014 08:28:29 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=YunJJkbqpzIhwb/NLam44dH7jX96kkqRUSSF8fXZfyM=; b=xeRB33DWr+JLgHF2j7B9wrIgOsbGLAT+XKDNnVxnmMXJv1O0QdqevJx/i+luCcBfZQ 3+v91gQR3Ys40oT5sMkZ4GJT+mjFNNE1khuO/8USaN0phxsIFvCsqH1SRprraBRFBo7t NP8/FngRnyrDeZGqTAo38NONfyNwAi7lZVGjyGdIQeRRQKkYk4BNAjmRqC8yaAYRstKW daBfW+AqAAx1ik+ZoAVkoVqgJw/0q58TE8RO3Y/rRNMXRqHiwRDlkR5D4+7qOJ4lf3YO hk8hnt5rszHA5HACNMupm4xBKKH1UeWJqQfXON1PvfysAMo+IT0V9be3LEe5d02JJRVV ezKw== X-Received: by 10.112.199.232 with SMTP id jn8mr32456248lbc.30.1410856106840; Tue, 16 Sep 2014 01:28:26 -0700 (PDT) From: =?UTF-8?q?=C3=98ystein=20Walle?= To: zsh-workers@zsh.org Cc: =?UTF-8?q?=C3=98ystein=20Walle?= Subject: [PATCH] Fun! Date: Tue, 16 Sep 2014 10:28:06 +0200 Message-Id: <1410856096-2109-1-git-send-email-oystwa@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Øystein Walle --- SW/source/installdeps.sh | 56 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/SW/source/installdeps.sh b/SW/source/installdeps.sh index 059ff3c..5a6dece 100755 --- a/SW/source/installdeps.sh +++ b/SW/source/installdeps.sh @@ -9,6 +9,26 @@ QCHARTSDIR=$BUILDDIR/include/qtcharts depsdir=$PWD/deps topdir=$PWD +# Define colors if stdout is a terminal +if [ -t 1 ]; then + # green=$(tput setaf 2) + # red=$(tput setaf 1) + # reset=$(tput sgr0) + red='' + green='' + reset='(B' +else + red= green= reset= +fi + +printok() { + printf "$green[OK]$reset %s\n" "$1" +} + +printerr() { + printf "$red[ERROR]$reset %s\n" "$1" >&2 +} + # compiling with mingw will yield 'Msys', while linux distros will yield 'GNU/Linux' DETECTED_OS=$(uname -o) @@ -33,9 +53,9 @@ if [ ! -d "$BUILDDIR" ]; then mkdir $BUILDDIR/bin mkdir $BUILDDIR/lib mkdir $BUILDDIR/html - echo "[OK]" + printok else - echo "[OK] Build Directory Found" + printok "Build Directory Found" fi echo "" @@ -58,9 +78,9 @@ if [ ! -d "$GTESTDIR" ]; then cp gtest.a $BUILDDIR/lib cp -r ./../include $BUILDDIR cd $topdir - echo "[OK]" + printok else - echo "[OK] Google Test Found" + printok "Google Test Found" fi echo "" @@ -87,9 +107,9 @@ if [ ! -d "$QCHARTSDIR" ]; then qmake CONFIG+="debug_and_release build_all nomake_demos_examples"; $MAKE -j1; $SUDO $MAKE install mkdir $BUILDDIR/include/qtcharts cd $topdir - echo "[OK]" + printok else - echo "[OK] QtCharts Found" + printok "QtCharts Found" fi echo "" @@ -115,9 +135,9 @@ if [ ! -d "$ZLIBDIR" ]; then cp zconf.h $BUILDDIR/include/zlib cp libz.a $BUILDDIR/lib cd $topdir - echo "[OK]" + printok else - echo "[OK] Zlib Found" + printok "Zlib Found" fi echo "" @@ -145,9 +165,9 @@ if [ ! -d "$PROTODIR" ]; then then exit 1 fi cd $topdir - echo "[OK]" + printok else - echo "[OK] Protobuf Found" + printok "Protobuf Found" fi echo "" @@ -164,9 +184,9 @@ if [ ! -d "$EIGENDIR" ]; then mkdir $BUILDDIR/include/eigen cp -r . $BUILDDIR/include/eigen cd $topdir - echo "[OK]" + printok else - echo "[OK] Eigen FFT Found" + printok "Eigen FFT Found" fi echo "" @@ -192,12 +212,12 @@ if [ "$DETECTED_OS" = "Msys" ]; then if [ ! -f $BUILDDIR/release/Compress2003 ]; then cp $topdir/libs/compresslib/Compress2003.dll $BUILDDIR/release fi - echo "[OK] - installed/verified compressions libs for $DETECTED_OS" + printok "installed/verified compressions libs for $DETECTED_OS" echo "" elif [ "$DETECTED_OS" = "GNU/Linux" ]; then - echo "[OK] - no compression libs neccessary for $DETECTED_OS" + printok "no compression libs neccessary for $DETECTED_OS" else - echo "[ERROR] - failed installing compression libs, OS: $DETECTED_OS not recognized" + printerr "failed installing compression libs, OS: $DETECTED_OS not recognized" fi echo "Verifying SQL libraries Available" @@ -212,7 +232,7 @@ if [ "$DETECTED_OS" = "Msys" ]; then if [ ! -f $BUILDDIR/release/sqldrivers/qsqloci.dll ]; then cp $topdir/libs/sqldrivers/qsqloci.dll $BUILDDIR/release/sqldrivers/ fi - echo "[OK] - installed SQL drivers for $DETECTED_OS" + printok "installed SQL drivers for $DETECTED_OS" elif [ "$DETECTED_OS" = "GNU/Linux" ]; then if [ ! -f $BUILDDIR/debug/sqldrivers/libqsqloci.so ]; then cp $topdir/libs/sqldrivers/libqsqloci.so $BUILDDIR/debug/sqldrivers/ @@ -220,7 +240,7 @@ elif [ "$DETECTED_OS" = "GNU/Linux" ]; then if [ ! -f $BUILDDIR/release/sqldrivers/libqsqloci.so ]; then cp $topdir/libs/sqldrivers/libqsqloci.so $BUILDDIR/release/sqldrivers/ fi - echo "[OK] - installed/verified SQL drivers for $DETECTED_OS" + printok "installed/verified SQL drivers for $DETECTED_OS" else - echo "[ERROR] - failed installing SQL drivers, OS: $DETECTED_OS not recognized" + printerr "failed installing SQL drivers, OS: $DETECTED_OS not recognized" fi -- 2.0.1