--- /usr/bin/java-check-environment 2006-07-29 00:56:52.000000000 +0200 +++ java-check-environment 2006-07-31 11:31:00.000000000 +0200 @@ -167,8 +167,9 @@ # Checks that a system-vm for generation-1 is set check_generation_1_system_vm() { local this_result=0 + local env="/etc/env.d/20java" # Make sure a generation-1 VM is set - if [[ ! -f /etc/env.d/20java ]]; then + if [[ ! -f "${env}" ]]; then qeerror "No Generation-1 System VM is set!" qeerror "Run 'java-config-1 -L' to see a list of available VMs" qeerror "Then run 'java-config-1 -S '" @@ -178,8 +179,21 @@ qeerror "Run 'java-config-1 -L' to see a list of available VMs" qeerror "Then run 'java-config-1 -S '" this_result=1 + # Make sure the generation-1 VM set is generation-2 compatible, not set long before migration + else + # We need to unset GENERATION, because this ends up being in + # the environment. + local OLD_GENERATION=${GENERATION} + unset GENERATION + local generation=$(source ${env}; echo $GENERATION) + if [[ "${generation}z" != "2z" ]]; then + qeerror "Current Generation-1 System VM env isn't Generation-2 ready and needs to be set again" + qeerror "Run 'java-config-1 -L' to see a list of available VMs" + qeerror "Then run 'java-config-1 -S '" + this_result=1 + fi + GENERATION=${OLD_GENERATION} fi - update_result ${this_result} return ${this_result}