summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlávek Banko <slavek.banko@axis.cz>2014-06-28 12:34:20 +0200
committerSlávek Banko <slavek.banko@axis.cz>2014-06-28 12:34:20 +0200
commit5bf2f6278bef192cb942c84918aab57a4cb31a8f (patch)
treef0315d3b88179cc489336aa7c181500fd2df5cc1
parentc75218cd1e4d06239eda0405f8c2da6a2f357159 (diff)
downloadtdebase-5bf2f6278bef192cb942c84918aab57a4cb31a8f.tar.gz
tdebase-5bf2f6278bef192cb942c84918aab57a4cb31a8f.zip
Improved previous commit c75218cd
This relates to Bug 2069.
-rwxr-xr-xstarttde15
1 files changed, 9 insertions, 6 deletions
diff --git a/starttde b/starttde
index f6607a129..9f093a773 100755
--- a/starttde
+++ b/starttde
@@ -34,7 +34,6 @@ is_before_in_path() {
var="$1"; search="$2"; before="$3"
ifs="$IFS"; IFS=":"; eval set \$$var; IFS="$ifs"
for i in $*; do
- echo "${i}, ${search}, ${before}"
[ "${i}" = "${search}" ] && return 0
[ "${i}" = "${before}" ] && return 1
done
@@ -279,11 +278,15 @@ if [ "$TDEDIR" != "/usr" ] && [ -d $TDEDIR/share ]; then
fi
# Ensure that $TDEDIR/share is always before '/usr/local/share' and '/usr/share'.
- remove_from_path XDG_DATA_DIRS $TDEDIR/share
- if is_before_in_path XDG_DATA_DIRS "/usr/local/share" "/usr/share"; then
- place_before_in_path XDG_DATA_DIRS "$TDEDIR/share" "/usr/local/share"
- else
- place_before_in_path XDG_DATA_DIRS "$TDEDIR/share" "/usr/share"
+ if ! is_in_path XDG_DATA_DIRS "$TDEDIR/share" ||
+ is_before_in_path XDG_DATA_DIRS "/usr/local/share" "$TDEDIR/share" ||
+ is_before_in_path XDG_DATA_DIRS "/usr/share" "$TDEDIR/share"; then
+ remove_from_path XDG_DATA_DIRS "$TDEDIR/share"
+ if is_before_in_path XDG_DATA_DIRS "/usr/local/share" "/usr/share"; then
+ place_before_in_path XDG_DATA_DIRS "$TDEDIR/share" "/usr/local/share"
+ else
+ place_before_in_path XDG_DATA_DIRS "$TDEDIR/share" "/usr/share"
+ fi
fi
# Adds supplementary directories from TDEDIRS, if any, before TDEDIR.