diff options
author | Joshua Nichols <nichoj@gentoo.org> | 2006-08-31 01:03:11 +0000 |
---|---|---|
committer | Joshua Nichols <nichoj@gentoo.org> | 2006-08-31 01:03:11 +0000 |
commit | cdaa3932e24ac6cca5b67e44305f69833bf4974e (patch) | |
tree | 62d4cf9e1c200cc9bab86b72f05b9cb25ad0bfa2 /eclass | |
parent | Add -j1 thanks to David Grant <davidgrant@gmail.com> and Lars Strojny <lars@s... (diff) | |
download | gentoo-2-cdaa3932e24ac6cca5b67e44305f69833bf4974e.tar.gz gentoo-2-cdaa3932e24ac6cca5b67e44305f69833bf4974e.tar.bz2 gentoo-2-cdaa3932e24ac6cca5b67e44305f69833bf4974e.zip |
Changed use of =~ to using wildcards, allowing us to remove the bash-3 dependency. Also improved some of the checks during postinstall, to make sure the Java environment is sane.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-vm-2.eclass | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/eclass/java-vm-2.eclass b/eclass/java-vm-2.eclass index 0b776efd80ab..db80cb5b4d79 100644 --- a/eclass/java-vm-2.eclass +++ b/eclass/java-vm-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.7 2006/08/01 13:43:04 cardoe Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-vm-2.eclass,v 1.8 2006/08/31 01:03:11 nichoj Exp $ # # Author: Karl Trygve Kalleberg <karltk@gentoo.org> @@ -12,8 +12,7 @@ DEPEND=" >=sys-apps/portage-2.1" RDEPEND=" =dev-java/java-config-2.0* - =dev-java/java-config-1.3* - >=app-shells/bash-3" + =dev-java/java-config-1.3*" export WANT_JAVA_CONFIG=2 @@ -35,15 +34,31 @@ java-vm-2_pkg_postinst() { fi if [[ ${JAVA_VM_NO_GENERATION1} != "true" ]]; then - local systemvm1="$(java-config-1 -f)" + local systemvm1="$(java-config-1 -f 2>/dev/null)" # no generation-1 system-vm was yet set if [[ -z "${systemvm1}" ]]; then - einfo "No valid generation-1 system-vm set, setting to ${P}" - java-config-1 --set-system-vm=${P} + # if 20java exists, must be using old VM + if [[ -f /etc/env.d/20java ]]; then + ewarn "The current generation-1 system-vm is using an out-of-date VM," + ewarn "as in, it hasn't been updated for use with the new Java sytem." + # othewise, it must not have been set before + else + ewarn "No generation-1 system-vm previously set." + fi + ewarn "Setting generation-1 system-vm to ${VMHANDLE}" + java-config-1 --set-system-vm=${P} 2>/dev/null # dirty check to see if we are upgrading current generation-1 system vm - elif [[ ${systemvm1} =~ "^${VMHANDLE}" ]]; then - einfo "Upgrading generation-1 system-vm... updating its env file" - java-config-1 --set-system-vm=${P} + elif [[ "${systemvm1}" = ${VMHANDLE}* ]]; then + einfo "Emerging the current generation-1 system-vm..." + einfo "Updating its config files." + java-config-1 --set-system-vm=${P} 2>/dev/null + # dirty check to see if current system vm is a jre - replace it with + elif [[ "${systemvm1}" = *jre* ]]; then + ewarn "Current generation-1 system-vm is a JRE" + ewarn "For the new and old Java systems to coexist," + ewarn "the generation-1 system-vm must be a JDK." + ewarn "Setting generation-1 system-vm to ${VMHANDLE}" + java-config-1 --set-system-vm=${P} 2>/dev/null fi # else... some other VM is being updated, so we don't have to worry fi |