[106780] trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl

cal at macports.org cal at macports.org
Fri Jun 7 18:11:28 PDT 2013


Revision: 106780
          https://trac.macports.org/changeset/106780
Author:   cal at macports.org
Date:     2013-06-07 18:11:28 -0700 (Fri, 07 Jun 2013)
Log Message:
-----------
active_variants: avoid using a variables named "name"

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl

Modified: trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl	2013-06-08 01:09:13 UTC (rev 106779)
+++ trunk/dports/_resources/port1.0/group/active_variants-1.1.tcl	2013-06-08 01:11:28 UTC (rev 106780)
@@ -91,14 +91,14 @@
 	# get the port which will provide $depspec; this allows us to support e.g.,
 	# path-style dependencies. This comes from port1.0/portutil.tcl and should
 	# probably not be considered public API.
-	set name [_get_dep_port $depspec]
-	if {$name == ""} {
+	set port [_get_dep_port $depspec]
+	if {$port == ""} {
 	    ui_error "active_variants: Error: invalid port depspec '${depspec}'"
 	    ui_error "  expecting either: port or (bin:lib:path):foo:port"
 	    return 0
 	}
-	if {$depspec != $name} {
-	    ui_debug "Checking $name for active variants for depspec '$depspec'"
+	if {$depspec != $port} {
+	    ui_debug "Checking $port for active variants for depspec '$depspec'"
 	}
 
 	# registry_active comes from a list of aliased procedures in
@@ -111,7 +111,7 @@
 	#
 	# In the SQLite case the call goes to registry2.0/receipt_sqlite.tcl,
 	# line 45, proc active, which in turn calls registry::entry installed
-	# $name, which comes from registry2.0/entry.c, line 387. I won't dig
+	# $port, which comes from registry2.0/entry.c, line 387. I won't dig
 	# deeper than that, since that's as far as we need to go to handle this
 	# correctly.
 	#
@@ -122,8 +122,8 @@
 	# same time). This explains the [lindex $active_list 0] in the following
 	# block.
 
-	# this will throw if $name isn't active
-	set installed [lindex [registry_active $name] 0]
+	# this will throw if $port isn't active
+	set installed [lindex [registry_active $port] 0]
 
 	# In $installed there are in order: name, version, revision, variants,
 	# a boolean indicating whether the port is installed and the epoch. So,
@@ -179,11 +179,11 @@
 	global _require_active_variants_list
 	foreach _require_active_variant $_require_active_variants_list {
 		set depspec [lindex $_require_active_variant 0]
-		set name [_get_dep_port $depspec]
+		set port [_get_dep_port $depspec]
 		set required [lindex $_require_active_variant 1]
 		set forbidden [lindex $_require_active_variant 2]
 		if {[catch {set result [active_variants $depspec $required $forbidden]}] != 0} {
-			error "${name} is required, but not active."
+			error "${port} is required, but not active."
 		}
 		if {!$result} {
 			set str_required ""
@@ -198,7 +198,7 @@
 			if {$str_required != "" && $str_forbidden != ""} {
 				set str_combine " and "
 			}
-			error "${name} must be installed ${str_required}${str_combine}${str_forbidden}."
+			error "${port} must be installed ${str_required}${str_combine}${str_forbidden}."
 		}
 	}
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130607/141cb09e/attachment.html>


More information about the macports-changes mailing list