1 |
commit: 633fc2622b79f113ea9270f78954198fe7183ebd |
2 |
Author: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 28 21:46:43 2017 +0000 |
4 |
Commit: James Le Cuirot <chewi <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jan 2 22:54:55 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/eselect-java.git/commit/?id=633fc262 |
7 |
|
8 |
Sort java-vm targets in version order rather than alphanumeric |
9 |
|
10 |
Java 10 may be around the corner. |
11 |
|
12 |
NEWS | 1 + |
13 |
src/modules/java-vm.eselect.in | 9 ++++++--- |
14 |
2 files changed, 7 insertions(+), 3 deletions(-) |
15 |
|
16 |
diff --git a/NEWS b/NEWS |
17 |
index 3faaf11..a0102aa 100644 |
18 |
--- a/NEWS |
19 |
+++ b/NEWS |
20 |
@@ -2,6 +2,7 @@ |
21 |
|
22 |
* Don't emit (unset) or (not a symlink) on stderr (#549498) |
23 |
* Fix mkdir die message in java-vm module |
24 |
+ * Sort java-vm targets in version order rather than alphanumeric |
25 |
|
26 |
0.3.0: |
27 |
|
28 |
|
29 |
diff --git a/src/modules/java-vm.eselect.in b/src/modules/java-vm.eselect.in |
30 |
index 3d5de4d..917b4d0 100644 |
31 |
--- a/src/modules/java-vm.eselect.in |
32 |
+++ b/src/modules/java-vm.eselect.in |
33 |
@@ -12,10 +12,13 @@ VM_USER="${HOME}/.gentoo${EPREFIX}/java-config-2/current-user-vm" |
34 |
VM_CONFIG="${EROOT}/usr/share/java-config-2/vm" |
35 |
|
36 |
find_targets() { |
37 |
- local f |
38 |
- for f in ${VM_BASE}/* ; do |
39 |
- [[ -L ${f} ]] && echo $(basename ${f}) |
40 |
+ local TARGETS=() target |
41 |
+ |
42 |
+ for target in "${VM_BASE}"/*; do |
43 |
+ [[ -L "${target}" ]] && TARGETS+=( ${target##*/} ) |
44 |
done |
45 |
+ |
46 |
+ printf "%s\n" "${TARGETS[@]}" | sort -uV |
47 |
} |
48 |
|
49 |
sym_to_vm() { |