Ticket #18719: port.tcl.diff

File port.tcl.diff, 1.3 KB (added by blb@…, 15 years ago)

diff to port/port.tcl

  • port

    old new  
    3939package require macports
    4040package require Pextlib 1.0
    4141
     42trace add execution exit enter exit_cleanup
     43
     44proc exit_cleanup {commandstring op} {
     45    global exit_status ::debuglog ::debuglogname
     46    if {[info exists ::debuglog]} {
     47        close $::debuglog
     48        if {$exit_status == 0} {
     49            file delete -force $::debuglogname
     50        } else {
     51            puts "See the debug log at $::debuglogname"
     52        }
     53    }
     54}
     55
    4256
    4357# Standard procedures
    4458proc print_usage {args} {
     
    157171    }
    158172}
    159173
     174proc ui_channels {priority} {
     175    global ::debuglog ::debuglogname
     176    set default_channel [macports::ui_channels_default $priority]
     177    if {![info exists ::debuglog]} {
     178        set ::debuglogname [mktemp /tmp/macports_debug.XXXXXX]
     179        set ::debuglog [open $::debuglogname w]
     180    }
     181    return [concat $default_channel $::debuglog]
     182}
    160183
    161184# Form a composite version as is sometimes used for registry functions
    162185proc composite_version {version variations {emptyVersionOkay 0}} {
     
    36043627set global_options_base [array get global_options]
    36053628
    36063629# First process any remaining args as action(s)
     3630global exit_status
    36073631set exit_status 0
    36083632if { [llength $remaining_args] > 0 } {
    36093633