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>
This commit is contained in:
Salvador Cuñat 2017-10-28 16:04:09 +02:00 committed by Lubomir I. Ivanov
parent c6d85838b5
commit 1a0ea6cc97

View file

@ -38,6 +38,17 @@ function aborting() {
exit 1 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 # check for arguments and set options if any
# #
while [ $# -gt 0 ]; do 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 # Check if we have glib-2.0 installed. This is a dependency for
# mdbtools. # mdbtools.
# #
pkg-config --exists glib-2.0 if ! pkg-config --exists glib-2.0; then
[[ $? -ne 0 ]] && aborting "Glib-2.0 not installed" || \ aborting "Glib-2.0 not installed"
else
echo "----> Glib-2.0 exists: $(pkg-config --print-provides glib-2.0)" echo "----> Glib-2.0 exists: $(pkg-config --print-provides glib-2.0)"
fi
# Mdbtools # Mdbtools
# #
# Check if mdbtools devel package is avaliable, if it is not, download # Check if mdbtools devel package is avaliable, if it is not, download
# and build it. # and build it.
# #
pkg-config --exists libmdb if ! pkg-config --exists libmdb; then
if [ $? -ne 0 ]; then
echo "----> Downloading/Updating mdbtools " echo "----> Downloading/Updating mdbtools "
if [ -d "$BASEDIR"/mdbtools ]; then if [ -d "$BASEDIR"/mdbtools ]; then
cd "$BASEDIR"/mdbtools || aborting "Couldn't cd into $BASEDIR/mdbtools" 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" make "$JOBS" || aborting "Failed to build smtk2ssrf"
echo ">> Building smtk2ssrf completed <<" printf "
echo ">> Executable placed in $SSRF_PATH/smtk-import/build <<" >> Building smtk2ssrf completed <<
echo ">> To install system-wide, move there and run sudo make install <<" >> Executable placed in %s/smtk-import/build <<
>> To install system-wide, move there and run sudo make install <<\n" "$SSRF_PATH"