aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalph Sennhauser <sera@gentoo.org>2011-09-05 15:20:31 +0000
committerRalph Sennhauser <sera@gentoo.org>2011-09-05 15:20:31 +0000
commitebc36a4f5cc96c40aeda944abb44028077aa49cf (patch)
tree1b17ad26c7d1d0c18395e215ccd05f9aca03c99b
parentAdd describe_set_parameters and describe_set_options to eselect java-vm (diff)
downloadjava-config-ebc36a4f5cc96c40aeda944abb44028077aa49cf.tar.gz
java-config-ebc36a4f5cc96c40aeda944abb44028077aa49cf.tar.bz2
java-config-ebc36a4f5cc96c40aeda944abb44028077aa49cf.zip
Add update action to eselect java-vm
svn path=/projects/java-config-2/branches/generation3-support/; revision=8771
-rw-r--r--src/eselect/java-vm.eselect26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/eselect/java-vm.eselect b/src/eselect/java-vm.eselect
index 5b73f19..81d0925 100644
--- a/src/eselect/java-vm.eselect
+++ b/src/eselect/java-vm.eselect
@@ -170,4 +170,30 @@ set_symlink() {
fi
}
+### update action ###
+
+describe_update() {
+ echo "Sets a system VM if none is set or if the current link is broken."
+}
+
+# TODO respect arch/user defaults or take an argument? -sera
+do_update() {
+ if [[ ! -d $(canonicalise ${VM_SYSTEM}) ]]; then
+ local targets=( $(find_targets) )
+ if [[ ${#targets[@]} > 0 ]]; then
+ echo "No system VM is set, selecting \"${targets[0]}\""
+ echo "To set a different one use eselect java-vm"
+
+ do_set system ${targets[0]}
+ else
+ write_warning_msg "No suitable system VM could be found."
+ write_warning_msg "For Java applications to work install either a JDK or JRE."
+
+ rm -f ${VM_SYSTEM}
+ fi
+ else
+ echo "System VM already set, nothing to do."
+ fi
+}
+
# vim: set ft=eselect :