[108110] trunk/base/src/port1.0/portutil.tcl

larryv at macports.org larryv at macports.org
Sat Jul 13 00:29:13 PDT 2013


Revision: 108110
          https://trac.macports.org/changeset/108110
Author:   larryv at macports.org
Date:     2013-07-13 00:29:13 -0700 (Sat, 13 Jul 2013)
Log Message:
-----------
portutil.tcl: Rewrite environment_array_to_string.

Modified Paths:
--------------
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2013-07-13 06:46:00 UTC (rev 108109)
+++ trunk/base/src/port1.0/portutil.tcl	2013-07-13 07:29:13 UTC (rev 108110)
@@ -848,21 +848,14 @@
     }
 }
 
-# Build the environment as a string.
-# Remark: this method is only used for debugging purposes.
+# Return a string representation of the specified environment, for
+# debugging purposes.
 proc environment_array_to_string {environment_array} {
     upvar 1 ${environment_array} env_array
-
-    set theString ""
     foreach {key value} [array get env_array] {
-        if {$theString == ""} {
-            set theString "$key='$value'"
-        } else {
-            set theString "${theString} $key='$value'"
-        }
+        lappend env_list $key='$value'
     }
-
-    return $theString
+    return [join $env_list]
 }
 
 ########### Distname utility functions ###########
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130713/351d00c9/attachment.html>


More information about the macports-changes mailing list