Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Fun!
- X-seq: zsh-workers 33175
- From: Øystein Walle <oystwa@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [PATCH] Fun!
- Date: Tue, 16 Sep 2014 10:28:06 +0200
- Cc: Øystein Walle <ow@xxxxxxxxxxxxxx>
- 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==
- In-reply-to: <cover.1410851605.git.oystwa@gmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <cover.1410851605.git.oystwa@gmail.com>
From: Øystein Walle <ow@xxxxxxxxxxxxxx>
---
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='[31m'
+ green='[32m'
+ reset='(B[m'
+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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author