diff options
Diffstat (limited to 'libre/java-common/bin_parabola-java')
-rwxr-xr-x[-rw-r--r--] | libre/java-common/bin_parabola-java | 30 |
1 files changed, 5 insertions, 25 deletions
diff --git a/libre/java-common/bin_parabola-java b/libre/java-common/bin_parabola-java index e9bcbb25f..47f410096 100644..100755 --- a/libre/java-common/bin_parabola-java +++ b/libre/java-common/bin_parabola-java @@ -11,9 +11,6 @@ DEFAULT_NAME=default DEFAULT_PATH=${JVM_DIR}/${DEFAULT_NAME} DEFAULT_NAME_JRE=default-runtime DEFAULT_PATH_JRE=${JVM_DIR}/${DEFAULT_NAME_JRE} -BIN_PATH=/usr/bin -WRAPPER_PATH=/usr/lib/java-common-wrapper - # Utility functions @@ -38,7 +35,11 @@ check_param_count() { get_default_java() { path=$(readlink -e ${DEFAULT_PATH}) - echo ${path/${JVM_DIR}\/} + if [ "x${path}" != "x/dev/null" ]; then + echo ${path/${JVM_DIR}\/} + else + echo "" + fi } get_installed_javas() { @@ -61,20 +62,6 @@ is_java_valid() { test "x$1" != "x${DEFAULT_NAME}" && test -x ${JVM_DIR}/$1/bin/java } -set_bin_links() { - find ${DEFAULT_PATH}/bin ! -type d -perm /a=x \ - | while read bpath; do - ln -sf ${WRAPPER_PATH} ${BIN_PATH}/$(basename ${bpath}) > /dev/null 2>&1 - done -} - -unset_bin_links() { - find -L ${BIN_PATH} -samefile ${WRAPPER_PATH} \ - | while read lpath; do - unlink ${lpath} - done -} - # $1: Java environment name to set as default set_default_link_to() { new_default=$1 @@ -131,10 +118,8 @@ do_set() { default=$(get_default_java) if [ "x$1" != "x${default}" ] || ! is_java_valid ${default}; then unset_default_link - unset_bin_links set_default_link_to $1 fi - set_bin_links #parent_dir=$(dirname $1) #if is_java_valid ${parent_dir}; then @@ -146,7 +131,6 @@ do_set() { # $1: Java environment name to unset do_unset() { unset_default_link - unset_bin_links } do_fix() { @@ -156,19 +140,15 @@ do_fix() { unset_default_link set_default_link_to $(dirname ${default}) fi - unset_bin_links - set_bin_links else prev=$(readlink ${DEFAULT_PATH}) unset_default_link - unset_bin_links prev_fix=("${prev/\/jre}" "${prev}/jre") openjdk7=('java-7-openjdk' 'java-7-openjdk/jre') to_check=(${prev_fix[@]} ${openjdk7[@]} $(get_installed_javas)) for java in ${to_check[@]}; do if ! is_java_valid $(get_default_java) && is_java_valid ${java}; then set_default_link_to ${java} - set_bin_links fi done fi |