summaryrefslogtreecommitdiffstats
path: root/scripts/smtk2ssrf-build.sh
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2017-10-28 16:04:09 +0200
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2017-10-29 17:08:36 +0100
commit1a0ea6cc9715e50632af0f5cc1ac0f6bb476f589 (patch)
tree9f50f18c2ded97697f0b0a6186219b84c0c09222 /scripts/smtk2ssrf-build.sh
parentc6d85838b527d0a276eed08164880985f70004e0 (diff)
downloadsubsurface-1a0ea6cc9715e50632af0f5cc1ac0f6bb476f589.tar.gz
smtk2ssrf-build.sh: Add warning and some style fixes
Add a warning about overriding subsurface binary and make some scripting style changes. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
Diffstat (limited to 'scripts/smtk2ssrf-build.sh')
-rwxr-xr-xscripts/smtk2ssrf-build.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/scripts/smtk2ssrf-build.sh b/scripts/smtk2ssrf-build.sh
index 701932abb..987e55c9e 100755
--- a/scripts/smtk2ssrf-build.sh
+++ b/scripts/smtk2ssrf-build.sh
@@ -38,6 +38,17 @@ function aborting() {
exit 1
}
+printf "
+***** WARNING *****
+Please, note that this script will render your Subsurface binary unusable.
+So, if you are using the binary placed in build directory, you will need
+to rebuild it after running this script.
+
+Proceed? [y/n]\n"
+
+read -rs _proceed
+[[ $_proceed == "n" ]] && exit 0
+
# check for arguments and set options if any
#
while [ $# -gt 0 ]; do
@@ -67,17 +78,18 @@ export PKG_CONFIG_PATH="$BASEDIR/install-root/lib/pkgconfig"
# Check if we have glib-2.0 installed. This is a dependency for
# mdbtools.
#
-pkg-config --exists glib-2.0
-[[ $? -ne 0 ]] && aborting "Glib-2.0 not installed" || \
+if ! pkg-config --exists glib-2.0; then
+ aborting "Glib-2.0 not installed"
+else
echo "----> Glib-2.0 exists: $(pkg-config --print-provides glib-2.0)"
+fi
# Mdbtools
#
# Check if mdbtools devel package is avaliable, if it is not, download
# and build it.
#
-pkg-config --exists libmdb
-if [ $? -ne 0 ]; then
+if ! pkg-config --exists libmdb; then
echo "----> Downloading/Updating mdbtools "
if [ -d "$BASEDIR"/mdbtools ]; then
cd "$BASEDIR"/mdbtools || aborting "Couldn't cd into $BASEDIR/mdbtools"
@@ -157,6 +169,7 @@ cmake -DCMAKE_BUILD_TYPE="$RELEASE" .. || aborting "Cmake incomplete"
make "$JOBS" || aborting "Failed to build smtk2ssrf"
-echo ">> Building smtk2ssrf completed <<"
-echo ">> Executable placed in $SSRF_PATH/smtk-import/build <<"
-echo ">> To install system-wide, move there and run sudo make install <<"
+printf "
+>> Building smtk2ssrf completed <<
+>> Executable placed in %s/smtk-import/build <<
+>> To install system-wide, move there and run sudo make install <<\n" "$SSRF_PATH"