[51385] branches/gsoc09-logging/base/src/macports1.0/macports.tcl

enl at macports.org enl at macports.org
Sat May 23 14:21:00 PDT 2009


Revision: 51385
          http://trac.macports.org/changeset/51385
Author:   enl at macports.org
Date:     2009-05-23 14:21:00 -0700 (Sat, 23 May 2009)
Log Message:
-----------
Use interp instead of dynamic functions for ui_$priority

Modified Paths:
--------------
    branches/gsoc09-logging/base/src/macports1.0/macports.tcl

Modified: branches/gsoc09-logging/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc09-logging/base/src/macports1.0/macports.tcl	2009-05-23 20:29:46 UTC (rev 51384)
+++ branches/gsoc09-logging/base/src/macports1.0/macports.tcl	2009-05-23 21:21:00 UTC (rev 51385)
@@ -115,20 +115,20 @@
     return $::debuglog
 }
 
-proc ui_message {priority args} {
-    global macports::channels
-    foreach chan {$macports::channels} {
-    if {\[lindex \$args 0\] == "-nonewline"} {
-        puts -nonewline \$chan "$prefix\[lindex \$args 1\]"
-    } else {
-        puts \$chan "$prefix\[lindex \$args 0\]"
+proc ui_message {priority prefix args} {
+    global macports::channels 
+    foreach chan $macports::channels {
+        if {[lindex $args 0] == "-nonewline"} {
+            puts -nonewline $chan "$prefix[lindex $args 1]"
+        } else {
+            puts $chan "$prefix[lindex $args 0]"
+        }
     }
 }
 proc macports::ui_init {priority args} {
     global macports::channels
     set default_channel [macports::ui_channels_default $priority]
     set logging_file [init_logging]
-    puts "$portname"
     # Get the list of channels.
     try {
         set channels [concat [ui_channels $priority] $logging_file]
@@ -136,7 +136,7 @@
         set channels [concat $logging_file $default_channel]
     }
     # Simplify ui_$priority.
-    if {[llength $channels] == 0} {
+    if {[llength $channels] == 1} {
         proc ::ui_$priority {args} {}
     } else {
         try {
@@ -148,7 +148,7 @@
         try {
             eval ::ui_init $priority $prefix $channels $args
         } catch * {
-            interp alias {} ui_$priority {} ui_message $priority
+            interp alias {} ui_$priority {} ui_message $priority $prefix
         }
 
         # Call ui_$priority
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090523/d31563dd/attachment.html>


More information about the macports-changes mailing list