diff options
author | Andrew <forkk@forkk.net> | 2013-12-13 09:38:17 -0600 |
---|---|---|
committer | Andrew <forkk@forkk.net> | 2013-12-13 09:38:17 -0600 |
commit | e6e63307fd2920d9eaaf32fc1595e4a141ac3b25 (patch) | |
tree | ec5afc2a343dbda3e3601d6f17709522bbd29b60 /package | |
parent | b69351d50d07bab595945d064e4d29b123c19105 (diff) | |
download | MultiMC-e6e63307fd2920d9eaaf32fc1595e4a141ac3b25.tar MultiMC-e6e63307fd2920d9eaaf32fc1595e4a141ac3b25.tar.gz MultiMC-e6e63307fd2920d9eaaf32fc1595e4a141ac3b25.tar.lz MultiMC-e6e63307fd2920d9eaaf32fc1595e4a141ac3b25.tar.xz MultiMC-e6e63307fd2920d9eaaf32fc1595e4a141ac3b25.zip |
Made the run script look for missing dependencies.
On Linux, MultiMC's startup script will now look for plugins with
missing depenedencies and warn the user about them if they are missing.
Diffstat (limited to 'package')
-rwxr-xr-x | package/linux/MultiMC | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/package/linux/MultiMC b/package/linux/MultiMC index a2ef0c81..8229b24f 100755 --- a/package/linux/MultiMC +++ b/package/linux/MultiMC @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Basic start script for running MultiMC with the libs packaged with it. MMC_DIR=`dirname "$0"` @@ -10,9 +10,24 @@ export LD_LIBRARY_PATH="${MMC_DIR}/bin":$LD_LIBRARY_PATH export QT_PLUGIN_PATH="${MMC_DIR}/plugins" export QT_FONTPATH="${MMC_DIR}/fonts" -# Just to be sure... -chmod +x "${MMC_DIR}/bin/MultiMC" +# Detect missing dependencies... +DEPS_LIST=`ldd "${MMC_DIR}"/plugins/*/*.so | grep "not found" | awk -vORS=", " '{ print $1 }'` +if [ -z $DEPS_LIST ]; then + # We have all our dependencies. Run MultiMC. + echo "No missing dependencies found." -# run MultiMC -"${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@ + # Just to be sure... + chmod +x "${MMC_DIR}/bin/MultiMC" + + # Run MultiMC + "${MMC_DIR}/bin/MultiMC" -d "${MMC_DIR}" $@ + + # Exit with MultiMC's exit code. + exit $? +else + echo "Error: MultiMC is missing the following libraries that it needs to work correctly:" + echo "\t${DEPS_LIST}" + echo "Please install them from your distribution's package manager." + exit 1 +fi |