[72266] trunk/base/src/port/port.tcl

jberry at macports.org jberry at macports.org
Sat Oct 9 09:53:56 PDT 2010


Revision: 72266
          http://trac.macports.org/changeset/72266
Author:   jberry at macports.org
Date:     2010-10-09 09:53:52 -0700 (Sat, 09 Oct 2010)
Log Message:
-----------
Cleanup comments on foreachport. Also, ensure portspec variable gets unset before each block invocation in foreachport

Modified Paths:
--------------
    trunk/base/src/port/port.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2010-10-09 16:38:15 UTC (rev 72265)
+++ trunk/base/src/port/port.tcl	2010-10-09 16:53:52 UTC (rev 72266)
@@ -381,14 +381,14 @@
 
 
 # Execute the enclosed block once for every element in the portlist
-# When the block is entered, the variables portname, portversion, options, and variations
-# will have been set
+# When the block is entered, the following variables will have been set:
+#	portspec, porturl, portname, portversion, options, variations, requestion_variations
 proc foreachport {portlist block} {
-    # Restore cwd after each port, since mportopen changes it, and relative
-    # urls will break on subsequent passes
     set savedir [pwd]
     foreach portspec $portlist {
-        uplevel 1 "array set portspec { $portspec }"
+    
+        # Set the variables for the block
+        uplevel 1 "array unset portspec; array set portspec { $portspec }"
         uplevel 1 {
             set porturl $portspec(url)
             set portname $portspec(name)
@@ -400,7 +400,12 @@
             array unset options
             array set options $portspec(options)
         }
+        
+        # Invoke block
         uplevel 1 $block
+        
+        # Restore cwd after each port, since mportopen changes it, and otherwise relative
+        # urls would break on subsequent passes
         if {[file exists $savedir]} {
             cd $savedir
         } else {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20101009/7c8456f5/attachment.html>


More information about the macports-changes mailing list