diff options
author | James Le Cuirot <chewi@gentoo.org> | 2017-12-28 21:46:43 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2018-01-02 22:54:55 +0000 |
commit | 633fc2622b79f113ea9270f78954198fe7183ebd (patch) | |
tree | 90d9a20d71854994c7a3f65f0bbe3bd8645479b5 | |
parent | Fix mkdir die message in java-vm module (diff) | |
download | eselect-java-633fc2622b79f113ea9270f78954198fe7183ebd.tar.gz eselect-java-633fc2622b79f113ea9270f78954198fe7183ebd.tar.bz2 eselect-java-633fc2622b79f113ea9270f78954198fe7183ebd.zip |
Sort java-vm targets in version order rather than alphanumeric
Java 10 may be around the corner.
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | src/modules/java-vm.eselect.in | 9 |
2 files changed, 7 insertions, 3 deletions
@@ -2,6 +2,7 @@ * Don't emit (unset) or (not a symlink) on stderr (#549498) * Fix mkdir die message in java-vm module + * Sort java-vm targets in version order rather than alphanumeric 0.3.0: diff --git a/src/modules/java-vm.eselect.in b/src/modules/java-vm.eselect.in index 3d5de4d..917b4d0 100644 --- a/src/modules/java-vm.eselect.in +++ b/src/modules/java-vm.eselect.in @@ -12,10 +12,13 @@ VM_USER="${HOME}/.gentoo${EPREFIX}/java-config-2/current-user-vm" VM_CONFIG="${EROOT}/usr/share/java-config-2/vm" find_targets() { - local f - for f in ${VM_BASE}/* ; do - [[ -L ${f} ]] && echo $(basename ${f}) + local TARGETS=() target + + for target in "${VM_BASE}"/*; do + [[ -L "${target}" ]] && TARGETS+=( ${target##*/} ) done + + printf "%s\n" "${TARGETS[@]}" | sort -uV } sym_to_vm() { |