Index: src/port1.0/portactivate.tcl
===================================================================
--- src/port1.0/portactivate.tcl	(revision 24923)
+++ src/port1.0/portactivate.tcl	(working copy)
@@ -45,27 +45,9 @@
 } else {
 	target_requires ${com.apple.activate} main fetch extract checksum patch configure build destroot install
 }
-target_prerun ${com.apple.activate} activate_start
 
 set_ui_prefix
 
-proc activate_start {args} {
-	global UI_PREFIX portname portversion portrevision variations portvariants
-    
-	if { ![info exists portvariants] } {
-		set portvariants ""
-
-		set vlist [lsort -ascii [array names variations]]
-
-	 	# Put together variants in the form +foo+bar for the registry
-		foreach v $vlist {
-			if { ![string equal $v [option os.platform]] && ![string equal $v [option os.arch]] } {
-				set portvariants "${portvariants}+${v}"
-			}
-		}
-	}
-}
-
 proc activate_main {args} {
 	global portname portversion portrevision portvariants user_options
 	registry_activate $portname ${portversion}_${portrevision}${portvariants} [array get user_options]
Index: src/port1.0/portinstall.tcl
===================================================================
--- src/port1.0/portinstall.tcl	(revision 24923)
+++ src/port1.0/portinstall.tcl	(working copy)
@@ -48,20 +48,6 @@
 
 proc install_start {args} {
 	global UI_PREFIX portname portversion portrevision variations portvariants
-    
-	if { ![info exists portvariants] } {
-		set portvariants ""
-
-		set vlist [lsort -ascii [array names variations]]
-
-		# Put together variants in the form +foo+bar for the registry
-		foreach v $vlist {
-			if { ![string equal $v [option os.platform]] && ![string equal $v [option os.arch]] } {
-				set portvariants "${portvariants}+${v}"
-			}
-		}
-	}
-
 	ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s %s_%s%s"] $portname $portversion $portrevision $portvariants]"
 }
 
Index: src/port1.0/portutil.tcl
===================================================================
--- src/port1.0/portutil.tcl	(revision 24923)
+++ src/port1.0/portutil.tcl	(working copy)
@@ -990,18 +990,6 @@
 	    set result [catch {[ditem_key $ditem init] $name} errstr]
 	}
 	
-	if { ![info exists portvariants] } {
-		set portvariants ""
-		set vlist [lsort -ascii [array names variations]]
-
-		# Put together variants in the form +foo+bar for the registry
-		foreach v $vlist {
-			if { ![string equal $v [option os.platform]] && ![string equal $v [option os.arch]] } {
-				set portvariants "${portvariants}+${v}"
-			}
-		}
-	}
-
 	if {$result == 0} {
 		# Skip the step if required and explain why through ui_debug.
 		# 1st case: the step was already done (as mentioned in the state file)
@@ -1044,7 +1032,7 @@
 				# Say we're skipping.
 				set skipped 1
 				
-				ui_debug "Skipping $name ($portname) since this port is already active"
+				ui_msg "Skipping $name ($portname $portvariants) since this port is already active"
 			}
 			
 		}
@@ -1367,8 +1355,34 @@
     return 0
 }
 
+# Given a list of variant specifications, return a canonical string form
+# for the registry. 
+    # The strategy is as follows: regardless of how some collection of variants
+    # was turned on or off, a particular instance of the port is uniquely
+    # characterized by the set of variants that are *on*. Thus, record those
+    # variants in a string in a standard order as +var1+var2 etc.
+    # We can skip the platform and architecture since those are always
+    # requested.  XXX: Is that really true? What if the user explicitly
+    # overrides the platform and architecture variants? Will the registry get
+    # bollixed? It would seem safer to me to just leave in all the variants that
+    # are on, but for now I'm just leaving the skipping code as it was in the
+    # previous version.
+proc canonicalize_variants {variants} {
+    array set vara $variants
+    set result ""
+    set vlist [lsort -ascii [array names vara]]
+    foreach v $vlist {
+	    if { $vara($v) == "+"
+		 && ![string equal $v [option os.platform]]
+		 && ![string equal $v [option os.arch]]} {
+		    set result "${result}+${v}"
+	    }
+    }
+    return $result
+}
+
 proc eval_variants {variations target} {
-    global all_variants ports_force PortInfo
+    global all_variants ports_force PortInfo portvariants
     set dlist $all_variants
     set result 0
     upvar $variations upvariations
@@ -1401,7 +1415,10 @@
     if {[llength $dlist] > 0} {
 		return 1
     }
-    
+
+    # Record a canonical variant string, used e.g. in accessing the registry
+    set portvariants [canonicalize_variants [array get upvariations]]
+
     # Make sure the variations match those stored in the statefile.
     # If they don't match, print an error indicating a 'port clean' 
     # should be performed.  

