Ticket #15913: macports.tcl.patch

File macports.tcl.patch, 1.7 KB (added by armahg@…, 16 years ago)

Patch for macports.tcl

  • macports.tcl

     
    7676# ui_channels returns a list of channels to output the message to, empty for
    7777#     no message.
    7878# if these functions are not provided, defaults are used.
     79# Clients of the library may optionally provide ui_init with the following
     80# prototype.
     81#     proc ui_init {priority prefix channels message}
     82# ui_init needs to correctly define the proc ::ui_$priority {message} or throw
     83# an error.
     84# if this function is not provided or throws an error, default procedures for
     85# ui_$priority are defined.
    7986
    8087# ui_options accessor
    8188proc macports::ui_isset {val} {
     
    118125            set prefix [ui_prefix_default $priority]
    119126        }
    120127
    121         if {$nbchans == 1} {
    122             set chan [lindex $channels 0]
    123             proc ::ui_$priority {str} [subst { puts $chan "$prefix\$str" }]
    124         } else {
    125             proc ::ui_$priority {str} [subst {
    126                 foreach chan \$channels {
    127                     puts $chan "$prefix\$str"
    128                 }
    129             }]
     128        try {
     129            ::ui_init $priority $prefix $channels $message
     130        } catch * {
     131            if {$nbchans == 1} {
     132                set chan [lindex $channels 0]
     133                proc ::ui_$priority {str} [subst { puts $chan "$prefix\$str" }]
     134            } else {
     135                proc ::ui_$priority {str} [subst {
     136                    foreach chan \$channels {
     137                        puts $chan "$prefix\$str"
     138                    }
     139                }]
     140            }
    130141        }
    131142
    132143        # Call ui_$priority