aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2017-12-29 22:50:36 +0000
committerJames Le Cuirot <chewi@gentoo.org>2018-01-02 22:54:55 +0000
commit27140082a5c7f0ce57adcddf52681f556ca1fb36 (patch)
treec08344f01dadc64b89ee3cc3a923ddc572af2f84 /src
parentSort java-vm targets in version order rather than alphanumeric (diff)
downloadeselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.tar.gz
eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.tar.bz2
eselect-java-27140082a5c7f0ce57adcddf52681f556ca1fb36.zip
Fix showing and highlighting current ecj and mvn targets (#585224)
Diffstat (limited to 'src')
-rw-r--r--src/modules/ecj.eselect.in9
-rw-r--r--src/modules/maven.eselect.in9
2 files changed, 10 insertions, 8 deletions
diff --git a/src/modules/ecj.eselect.in b/src/modules/ecj.eselect.in
index 7b6d784..353bcc5 100644
--- a/src/modules/ecj.eselect.in
+++ b/src/modules/ecj.eselect.in
@@ -38,8 +38,8 @@ find_target() {
# determine the current target.
get_target() {
- local canonicalised=$(canonicalise "${ECJ}")
- echo $(basename "${canonicalised}")
+ local target=$(readlink "${ECJ}")
+ echo ${target##*/}
}
### show action ###
@@ -76,11 +76,12 @@ do_list() {
die -q "Usage error: no parameters allowed."
fi
- local i targets
+ local i targets target
targets=( $(find_targets) )
+ target=$(get_target)
for (( i = 0; i < ${#targets[@]}; i++ )); do
- [[ ${targets[i]} = $(basename "$(canonicalise "${ECJ}")") ]] \
+ [[ ${targets[i]} = ${target} ]] \
&& targets[i]=$(highlight_marker "${targets[i]}")
done
diff --git a/src/modules/maven.eselect.in b/src/modules/maven.eselect.in
index f0cf2e4..247fee7 100644
--- a/src/modules/maven.eselect.in
+++ b/src/modules/maven.eselect.in
@@ -41,8 +41,8 @@ remove_symlink() {
# determine the current target.
get_target() {
- local canonicalised=$(canonicalise "${MVN}")
- echo $(basename "${canonicalised}")
+ local target=$(readlink "${MVN}")
+ echo ${target##*/}
}
# set the Maven symlink.
@@ -86,11 +86,12 @@ do_list() {
die -q "Usage error: no parameters allowed."
fi
- local i targets
+ local i targets target
targets=( $(find_targets) )
+ target=$(get_target)
for (( i = 0; i < ${#targets[@]}; i++ )); do
- [[ ${targets[i]} = $(basename "$(canonicalise "${MVN}")") ]] \
+ [[ ${targets[i]} = ${target} ]] \
&& targets[i]=$(highlight_marker "${targets[i]}")
done