diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2014-06-28 12:34:20 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2014-06-28 12:34:20 +0200 |
commit | 5bf2f6278bef192cb942c84918aab57a4cb31a8f (patch) | |
tree | f0315d3b88179cc489336aa7c181500fd2df5cc1 /starttde | |
parent | c75218cd1e4d06239eda0405f8c2da6a2f357159 (diff) | |
download | tdebase-5bf2f6278bef192cb942c84918aab57a4cb31a8f.tar.gz tdebase-5bf2f6278bef192cb942c84918aab57a4cb31a8f.zip |
Improved previous commit c75218cd
This relates to Bug 2069.
Diffstat (limited to 'starttde')
-rwxr-xr-x | starttde | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -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. |