summaryrefslogtreecommitdiffstats
path: root/remote
diff options
context:
space:
mode:
authorJonathan Bauer2014-04-17 15:14:10 +0200
committerJonathan Bauer2014-04-17 15:14:10 +0200
commit46bfcd5cf5c95b1ae8bb7cd3a9770ef5f223ba00 (patch)
tree5768ea56a133b2e3694f3508853865b74fa57d52 /remote
parent[vmware] forgot to remove debug shells in chroot (diff)
parentMerge branch 'master' of dnbd3:openslx-ng/tm-scripts (diff)
downloadtm-scripts-46bfcd5cf5c95b1ae8bb7cd3a9770ef5f223ba00.tar.gz
tm-scripts-46bfcd5cf5c95b1ae8bb7cd3a9770ef5f223ba00.tar.xz
tm-scripts-46bfcd5cf5c95b1ae8bb7cd3a9770ef5f223ba00.zip
Merge branch 'master' of git.openslx.org:openslx-ng/tm-scripts
Diffstat (limited to 'remote')
-rw-r--r--remote/includes/qt.inc18
1 files changed, 13 insertions, 5 deletions
diff --git a/remote/includes/qt.inc b/remote/includes/qt.inc
index e14aed4b..f0e3f3e6 100644
--- a/remote/includes/qt.inc
+++ b/remote/includes/qt.inc
@@ -1,21 +1,29 @@
activate_qt() {
[ $# -eq 1 ] || perror "activate_qt() requires the version as only argument, $# given."
local QT_VERSION="$1"
+ # Handle environment
+ export QT_SELECT="qt${QT_VERSION}"
+ QTDIR="/usr/share/qt${QT_VERSION}"
+ [ -d "$QTDIR" ] && export QTDIR
+ # Handle qt chooser
+ [ -d "/usr/share/qtchooser" ] || return 0 # No qtchooser found, hope for the best...
local QT_DEFAULT="$(readlink -f /usr/share/qtchooser/default.conf)"
if [ -e "$QT_DEFAULT" ]; then
[[ "$(basename "$QT_DEFAULT")" =~ ^qt$QT_VERSION.*\.conf$ ]] || perror "Something with QT4 is bad. Check '/usr/share/qtchooser'"
else
# no default active, try to set it
- local QT_CANDIDATES="$(ls /usr/share/qtchooser | grep -v default.conf | grep qt$QT_VERSION)"
- local QTS="$(echo $QT_CANDIDATES | wc -w)"
+ local QT_CANDIDATES="$(ls "/usr/share/qtchooser" | grep -v "default.conf" | grep "qt$QT_VERSION")"
+ local QTS="$(echo "$QT_CANDIDATES" | wc -w)"
if [ "$QTS" -eq 1 ]; then
# we found it, lets activate it and hope for the best
- ln -sf /usr/share/qtchooser/$QT_CANDIDATES /usr/share/qtchooser/default.conf \
- || perror "Could not link 'default.conf' to '/usr/share/qtchooser/$QT_CANDIDATES'"
+ ln -sf "/usr/share/qtchooser/$QT_CANDIDATES" "/usr/share/qtchooser/default.conf" \
+ || perror "Could not link 'default.conf' to '/usr/share/qtchooser/$QT_CANDIDATES'"
+ elif [ "$QTS" -eq 0 ]; then
+ perror "No qt ${QT_VERSION} config found in /usr/share/qtchooser"
else
# here we have the case with different qt4 files or none at all
# in both cases, there is a bigger problem we shouldn't try to guess which one is correct
- perror "Either none or more than 1 qt4 version found in '/usr/share/qtchooser'. The configuration is messy. Fix it first."
+ perror "More than one qt ${QT_VERSION} version found in '/usr/share/qtchooser'. The configuration is messy. Fix it first."
fi
fi
}