summaryrefslogtreecommitdiff
blob: 5d28efd5b1b219c9aeff3ac36a6b418f9916b6f7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- /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 <VM choice>'"
@@ -178,8 +179,21 @@
 		qeerror "Run 'java-config-1 -L' to see a list of available VMs"
 		qeerror "Then run 'java-config-1 -S <VM choice>'"
 		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 <VM choice>'"
+		this_result=1
+	    fi
+	    GENERATION=${OLD_GENERATION}
 	fi
-	
 
 	update_result ${this_result}
 	return ${this_result}