[51411] branches/gsoc09-logging/base/src/macports1.0/macports.tcl
enl at macports.org
enl at macports.org
Sun May 24 03:06:47 PDT 2009
Revision: 51411
http://trac.macports.org/changeset/51411
Author: enl at macports.org
Date: 2009-05-24 03:06:46 -0700 (Sun, 24 May 2009)
Log Message:
-----------
Made $channels var (and now an array) global for easier future modifications
The problem is interp hardcode $channels, so there is no chance to change it. The only way I see - make it global and an array
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-24 09:53:22 UTC (rev 51410)
+++ branches/gsoc09-logging/base/src/macports1.0/macports.tcl 2009-05-24 10:06:46 UTC (rev 51411)
@@ -115,8 +115,9 @@
return $::debuglog
}
-proc ui_message {priority prefix channels args} {
- foreach chan $channels {
+proc ui_message {priority prefix args} {
+ global macports::channels
+ foreach chan $macports::channels($priority) {
if {[lindex $args 0] == "-nonewline"} {
puts -nonewline $chan "$prefix[lindex $args 1]"
} else {
@@ -130,13 +131,13 @@
set logging_file [init_logging]
# Get the list of channels.
try {
- set channels [concat [ui_channels $priority] $logging_file]
+ set channels($priority) [concat [ui_channels $priority] $logging_file]
} catch * {
- set channels [concat $logging_file $default_channel]
+ set channels($priority) [concat $logging_file $default_channel]
}
# Simplify ui_$priority.
- if {[llength $channels] == 0} {
+ if {[llength $channels($priority)] == 0} {
proc ::ui_$priority {args} {}
} else {
try {
@@ -146,9 +147,9 @@
}
try {
- eval ::ui_init $priority $prefix $channels $args
+ eval ::ui_init $priority $prefix $channels($priority) $args
} catch * {
- interp alias {} ui_$priority {} ui_message $priority $prefix $channels
+ 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/20090524/40713a1e/attachment.html>
More information about the macports-changes
mailing list