diff options
author | Thomas Matthijs <axxo@gentoo.org> | 2004-10-19 13:10:41 +0000 |
---|---|---|
committer | Thomas Matthijs <axxo@gentoo.org> | 2004-10-19 13:10:41 +0000 |
commit | a738b0e96b34850a0f0cefe25e6136f24356ac01 (patch) | |
tree | d2647a23306c6193178856da0b31d941228f2bee /eclass | |
parent | Version bump; includes new version of gentoo-bashcomp as well (new equery com... (diff) | |
download | gentoo-2-a738b0e96b34850a0f0cefe25e6136f24356ac01.tar.gz gentoo-2-a738b0e96b34850a0f0cefe25e6136f24356ac01.tar.bz2 gentoo-2-a738b0e96b34850a0f0cefe25e6136f24356ac01.zip |
add another check to make sure the system vm is good enough to build the package
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/java-pkg.eclass | 3 | ||||
-rw-r--r-- | eclass/java-utils.eclass | 33 |
2 files changed, 21 insertions, 15 deletions
diff --git a/eclass/java-pkg.eclass b/eclass/java-pkg.eclass index 978cab2dd85c..c74661f0bb90 100644 --- a/eclass/java-pkg.eclass +++ b/eclass/java-pkg.eclass @@ -1,8 +1,7 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg.eclass,v 1.16 2004/10/16 21:32:09 axxo Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg.eclass,v 1.17 2004/10/19 13:10:41 axxo Exp $ -inherit base ECLASS=java-pkg INHERITED="${INHERITED} ${ECLASS}" IUSE="${IUSE}" diff --git a/eclass/java-utils.eclass b/eclass/java-utils.eclass index 3400d69efc6d..71a4b7fbd48f 100644 --- a/eclass/java-utils.eclass +++ b/eclass/java-utils.eclass @@ -19,10 +19,11 @@ EXPORT_FUNCTIONS pkg_setup java-utils_pkg_setup() { java-utils_ensure-jdk + + java-utils_vm-version-sufficient } java-utils_setup-vm() { - local vendor=`java-utils_get-vm-vendor` if [ ${vendor} = "sun-jdk" ] && java-utils_is-vm-version-ge 1 5; then addpredict "/dev/random" @@ -47,7 +48,7 @@ java-utils_is-vm-jdk() { return 0 else return 1 - fi + fi } java-utils_get-vm-vendor() { @@ -60,6 +61,13 @@ java-utils_get-vm-version() { echo ${version} } +java-utils_vm-version-sufficient() { + local version=$(echo ${DEPEND} | sed -e 's:.*virtual/jdk-\?\([^$ ]*\).*:\1:' -e 's:\.: :g') + if [ "${version}" != "" ]; then + java-utils_ensure-vm-version-ge ${version} + fi +} + java-utils_ensure-vm-version-ge() { if ! java-utils_is-vm-version-ge $@ ; then eerror "This package requires a Java VM version >= $@" @@ -69,18 +77,17 @@ java-utils_ensure-vm-version-ge() { } java-utils_is-vm-version-ge() { - local user_major=${1-0} - local user_minor=${2-0} - local user_patch=${3-0} + local user_major=${1:-0} + local user_minor=${2:-0} + local user_patch=${3:-0} local user_version=${user_major}.${user_minor}.${user_patch} - - local vm_version=`java-utils_get-vm-version` - - local ver_rx="([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" - local vm_major=$(echo ${vm_version} | sed -r "s/${ver_rx}/\1/") - local vm_minor=$(echo ${vm_version} | sed -r "s/${ver_rx}/\2/") - local vm_patch=$(echo ${vm_version} | sed -r "s/${ver_rx}/\3/") - local vm_extra=$(echo ${vm_version} | sed -r "s/${ver_rx}/\4/") + + local vm_version=$(java-utils_get-vm-version) + + local vm_major=$(echo ${vm_version} | cut -d. -f1) + local vm_minor=$(echo ${vm_version} | cut -d. -f2) + local vm_patch=$(echo ${vm_version} | cut -d. -f3) + local vm_extra=$(echo ${vm_version} | cut -d. -f4) if [ ${vm_major} -ge ${user_major} ] && [ ${vm_minor} -gt ${user_minor} ] ; then echo "Detected a JDK >= ${user_version}" |